Apache does not execute my php scripts - FIXED

I am running apache 2.4.10 on Debian 7.7 on Linode.

I installed PHP 5.6.26.

Apache does not execute my php scripts anymore. Instead, the browser displays the script itself.

I have done the following in order to fix this:

  • I checked that my php file has a php extension.

  • I checked the php code in this file, which is:

phpinfo();

?>

  • I checked that Apache is running, which is the case, otherwise my browser would not display the php code (I access the php file via my browser, with an adresss like http://www.mydomain.com/phpinfo.php

  • I checked that php is installed and running. I could run my script phpinfo.php from the command line, so I guess the issue is on the Apache side.

  • I checked that my php ini file is installed under /etc/php/php5/apache2 which is the case. I checked that this php ini file was set up according Linode recommandations in the linode documentation

  • I restarted apache, rebooted linode, restarted apache again.

Can anyone give me a hint about the way to troubleshoot this ?

UPDATED - Doing some research, I came to the idea to install the php module in Apache, this step is not included in the Linode instructions. It still a bit voodoo to me, but it seems to do the trick… (apt-get install libapache2-mod-php5 )

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct