I have a vps with bigrock which had php version 5.3.3 installed. I have recently upgraded php to version 5.6 because some php functions were not working. Now after removing old php and installing version 5.6 i can use php from terminal but files on my website are not being executed instead files are being downloaded with all php source code.

I think that apache is not using newly installed php. To solve this i added this line in my httpd.conf file :

LoadModule php5_module "/usr/bin/php"

This php path i got by which php command. When i added this line and restarted apache it gave me a warning

[warn] module php5_module is already loaded, skipping

I think that i need to tell apache correctly about newly installed php.

  • Look in the other '.conf' files - perhaps 'php.conf' You're being told that it has already been configured elsewhere. – marklark Dec 14 '15 at 17:42
  • Does your configuration have a SetHandler application/x-httpd-php or 'AddType application/x-httpd-php .php'? Apache is not sending the scripts to php to be parsed when the browser downloads the code. Module already loaded warning means LoadModule was defined more than once. – Gmck Dec 14 '15 at 18:07
  • I have added AddType application/x-httpd-php .php in httpd.conf. But i think that LoadModule is trying to load old version of php and i don't know in which configuration file. @Gmck – Vinit Chouhan Dec 14 '15 at 18:12
  • 1
    Are you on a cpanel/WHM server?. Cpanel/WHM servers have php module already in their templates. That might be the reason. – serverliving.com Dec 14 '15 at 18:25
  • No , not cpanel/WHM but i am using Parellels/plesk panel. @serverliving.com – Vinit Chouhan Dec 14 '15 at 19:29

Seing this:

LoadModule php5_module "/usr/bin/php"

I dont think that /usr/bin/php is the php module, it's the interpreter. Search for libphp5 or such, find /usr/lib | grep php or even better, list your php package's files and check for libphp, for example iwth rpm based distros:

for i in $(rpm -qa | grep php); do rpm -ql $i | grep libphp; done

Dont forget to check you're apache's error log too.

  • I have removed the LoadModule line. I checked the php.conf file in which libphp5.so is loading properly. and also there is nothing in error log file. Please suggest me something. My website is down. @fredi – Vinit Chouhan Dec 14 '15 at 19:27

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.