PHP Not Working After Following Tutorial On Setting Up (LAMP) stack on Ubuntu 14.04

Posted July 30, 2016 5.2k views

Hello! I started a new Ubuntu 14.04 droplet and followed the tutorial here:

Everything seemed to be going ok until i setup a simple test php page that just had php_info() on it. When I attempted to view the page online I got an HTTP Error 500. My apache error log reported:

[Sat Jul 30 12:38:01.847132 2016] [:error] [pid 6164] [client xx.xx.xx.xx:51976] PHP Fatal error: Call to undefined function php_info() in /var/www/html/info.php on line 3

Unsure what to do from here. Doing a php -v from the command line confirms PHP is installed and i’m not seeing errors (I did reboot Apache several times):

PHP 5.5.9-1ubuntu4.17 (cli) (built: May 19 2016 19:05:57)
Copyright © 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright © 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright © 1999-2014, by Zend Technologies

Googling for this didn’t seem to solve the problem. Suggestions?

  • Run the following and post results:

    ls -l /etc/apache2/mods*/php*
  • -rw-r–r– 1 root root 897 May 19 15:19 /etc/apache2/mods-available/php5.conf
    -rw-r–r– 1 root root 59 May 19 15:19 /etc/apache2/mods-available/php5.load
    lrwxrwxrwx 1 root root 27 Jul 30 12:29 /etc/apache2/mods-enabled/php5.conf -> ../mods-available/php5.conf
    lrwxrwxrwx 1 root root 27 Jul 30 12:29 /etc/apache2/mods-enabled/php5.load -> ../mods-available/php5.load

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

@dbisset - Change the call from php_info() to phpinfo()