0

Installed 16.04. installed 'apache2'. installed 'php', it gave me php7.0. But now my existng web pages with dot+php extensions are not being pre-processed by apache2.

I had a similar problem years ago with php5 and had to edit php.ini. But php 7.0 seems to have no php.ini file. html web pages are OK, but php web pages are blank.

Simplest test file is system("hostname"); which shows the machine name under 12.04/php5 but a blank screen under 16.04/php7.0.

  • In php5 there was one php.ini file. In php7.0 there are two:: cli/php.ini and fpm/php.ini. Where is this stuff documented? – Andy Canfield Jun 23 '16 at 9:34
  • Similarly this code - echo"Hello World"; - outputs nothing. – Andy Canfield Jun 23 '16 at 9:44
  • My packages list includes many with 'apache' in the name, and a few with 'php' in the name, but none with both words. Where is php connected to apache? – Andy Canfield Jun 23 '16 at 9:58
  • Thr URL DomainName.com/abc.php Is supposed to take the file abc.php and feed it through the php interpreter. the html that comes out is then sent to yourbrowser. But this is not haopening. – Andy Canfield Jun 23 '16 at 10:14
1

I think your website is not compatible with php7, but if you are sure that your problem is with "php.ini" take a look at this: https://stackoverflow.com/questions/34350350/php-7-0-1-couldnt-load-ini-file

Also please check your Apache log and Websait/Aplication log for what is happening when you open your page and paste the output.

Edit: I've just installed the same Stack on my 16.04 and it is working fine. These are the packages:

sudo apt install apache2
sudo apt install php libapache2-mod-php php-mcrypt

Please confirm that you have them.

Edit2: So the problem was: missing "libapache2-mod-php" package :)

  • Thank you. Where is the Apache log. "Websait/Application log" is where? – Andy Canfield Jun 23 '16 at 9:39
  • This is the standart place for the Apache error log -> /var/log/apache2/error.log and usually the error log of your application is in your /var/www/html (the path to your site). The name is different on different aplications (error_log, error.log etc.) – NIZ Jun 23 '16 at 11:35
  • @Andy Canfield please confirm that you have all the packages listed in the Edit. Sorry to not writining them in after your comment , but i dont have the repo needed. – NIZ Jun 23 '16 at 12:11
  • I did not have libapache2-mod-php or php-mcypt. Now installed. I will reboot and test in 30 minutes. Thanks. – Andy Canfield Jun 23 '16 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.