Apache with passenger and php modules, not executing php
I have a rails setup which is served by Apache Passenger, there are 2 apps on the server which are served by passenger and all was working fine. I then wanted to install wordpr开发者_StackOverflow中文版ess on the same server and so I installed the required packages "php5 php5-mysql libapache2-mod-php" and setup a separate vhost for wordpress, when I try to run the wordpress index.php file, apache doesn't execute but rather offers me to download.
I have googled this to no resolution, this problem is pretty common but none of the solutions have worked for me. Solutions that I have tried:
Adding "AddType application/x-httpd-php .php" in apache2.conf
making the wordpress directory executable, also changed the owner of the directory to www-data
In the vhost of wordpress, disabled Passenger by setting PassengerEnabled Off in the Directory directive.
Verified that php module is loaded by apache2ctl -M
Checked error log and nothing there, enabled error log for that vhost but nothing there.
any pointers, help appreciated thanks. BTW, the same setup works on local development box, its just this instance being painful can't recreate things from scratch.
Do you have a handler for the *.php extension?
My handler looks like this (with type included for clarity):
AddHandler php5-script .php
AddType text/html .php
Or from the documentation:
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
How did you enable the php module, did you use a2enmod or did you add it by hand?
Try removing the extra "AddType application/x-httpd-php .php" in apache2.conf and then run
sudo a2dismod php5; sudo a2enmod php5; sudo service apache2 restart
If you have already done that, please provide the contents of php5.conf, vhost file and everything else you believe is relative.
精彩评论