apache - Can't get php7 to work on apache2 -
i have major problem.
my apache2 not process php7 code instead shows codes straight in browser(chrome) or blank page(firefox)
many have had similar problem apparently managed solve it.
i have followed many threads on how working no avail.
also, have forced site work on https if issue.
information:
ubuntu release: ubuntu 16.04.3 lts
apache:
apache2 -v
server version: apache/2.4.18 (ubuntu)
server built: 2017-07-27t14:34:01
php:
php -v
php 7.0.22-0ubuntu0.16.04.1 (cli) ( nts ) copyright (c) 1997-2017 php group zend engine v3.0.0, copyright (c) 1998-2017 zend technologies zend opcache v7.0.22-0ubuntu0.16.04.1, copyright (c) 1999-2017, zend technologies
apache mods:
ls -lart /etc/apache2/mods-enabled/ php7.0.load -> ../mods-available/php7.0.load php7.0.conf -> ../mods-available/php7.0.conf
php module:
sudo a2enmod php7.0 considering conflict php5 php7.0: module php7.0 enabled
extract apache conf(/etc/apache2/sites-available):
<virtualhost *:443> servername ############ serveralias ############ documentroot /var/www/html/public errorlog /var/www/html/logs/eu_error_log customlog /var/www/html/logs/eu_access_log combined scriptalias /cgi-bin/ /var/www/html/cgi-bin/ directoryindex index.html index.htm index.php7 <directory /var/www/html/public> options -indexes +includesnoexec +symlinksifownermatch +execcgi allow allowoverride options=execcgi,includes,includesnoexec,indexes,multiviews,symlinksifownermatch require granted addtype application/x-httpd-php .php7 addtype application/x-httpd-php-source .phps addtype application/json .json </directory> <directory /var/www/html/cgi-bin> allow allowoverride options=execcgi,includes,includesnoexec,indexes,multiviews,symlinksifownermatch require granted </directory> <ifmodule mod_fastcgi.c> addhandler php7-fcgi .php7 action php7-fcgi /php7-fcgi alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi fastcgiexternalserver /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header authorization </ifmodule> # removehandler .php # removehandler .php7 php_admin_value engine on # ipccommtimeout 301 # fcgidmaxrequestlen 1073741824 php_value memory_limit 128m php_value suhosin.session.encrypt off sslengine on sslcertificatefile ############ sslcertificatekeyfile ############ # sslcacertificatefile ############ sslciphersuite ecdhe-rsa-aes128-gcm-sha256:ecdhe-ecdsa-aes128-gcm-sha256:ecdhe-rsa-aes256-gcm-sha384:ecdhe-ecdsa-aes256-gcm-sha384:dhe-rsa-aes128-gcm-sha256:dhe-dss-aes128-gcm-sha256:kedh+aesgcm:ecdhe-rsa-aes128-sha256:ecdhe-ecdsa-aes128-sha256:ecdhe-rsa-aes128-sha:ecdhe-ecdsa-aes128-sha:ecdhe-rsa-aes256-sha384:ecdhe-ecdsa-aes256-sha384:ecdhe-rsa-aes256-sha:ecdhe-ecdsa-aes256-sha:dhe-rsa-aes128-sha256:dhe-rsa-aes128-sha:dhe-dss-aes128-sha256:dhe-rsa-aes256-sha256:dhe-dss-aes256-sha:dhe-rsa-aes256-sha:ecdhe-rsa-des-cbc3-sha:ecdhe-ecdsa-des-cbc3-sha:edh-rsa-des-cbc3-sha:aes128-gcm-sha256:aes256-gcm-sha384:aes128-sha256:aes256-sha256:aes128-sha:aes256-sha:aes:camellia:des-cbc3-sha:!anull:!enull:!export:!des:!rc4:!md5:!psk:!aecdh:!edh-dss-des-cbc3-sha:!krb5-des-cbc3-sha sslprotocol -sslv2 -sslv3 sslcompression off sslhonorcipherorder on </virtualhost>
and www folder:
ls -lart /var/www/html/public/* -rw-r--r-- 1 root root 27 sep 10 15:35 .htaccess -rw-r--r-- 1 root root 29 sep 10 15:46 index.php7
content:
sudo cat /var/www/html/public/.htaccess directoryindex index.php7 sudo cat /var/www/html/public/index.php7: <?php echo "hello world"; ?>
a normal index.html produces proper output.
idea on else check?
Comments
Post a Comment