• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

apache not parsing php script

A

abubin

Guest
My server suddenly refuse to run php scripts. When I go to any php files, it will ask me to download the file application/x-httpd-php.

php already running fine. Did nothing to it except install plesk toys few days ago. Was working fine after plesk toys was installed.

I restarted apache tons and rebooted the server still facing this problem.

I command line, I type php -v and i do get php version showing.

Any idea how to fix this? All php sites are not functioning now!! Please it's urgent!! Thank you very much.
 
Did you check to see which modules are loaded in apache ? Try to see if the php module is set to load.
Also, you might want to check out /etc/apache/httpd.conf and make sure you have support for index.php files in DirectoryIndex:

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php
</IfModule>
 
make sure this exists in your httpd.conf file
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

DirectoryIndex wouldnt be your problem, it seems that the issue is related to MIME types as the server doesnt know what kind of file it is and doesnt know how to dislpay it.

Also make sure you dont have any vhost.conf or httpd.include files that are taking those mime types out
Something such as suphp or something similar remove those mime types and if its not working properly (assuming its even installed) could also be the issue.
 
Thanks for all the replies.

After hours of checking logs and configs and restarting apache for countless times, found out that problem is due to suPHP.

This suPHP was configured long time ago and was already working fine. I don't know why suddenly it just refuse to work. It is now disabled. Will check it later to see what was wrong.
 
You have updated maybe and the new configuration is not compatible anymore, new version require new settings.
 
Back
Top