View Full Version : PHP Executon
alexillsley
7th April 2007, 13:34
Hi,
Im having some problems with php. Not all php files excute.
removed_now/test.php5 (works)
removed_now/test.php (doesnt work)
Ive had this same problem before here: http://www.howtoforge.com/forums/showthread.php?t=9288&highlight=PHP
And the answer was to modify /etc/apache2/conf.d/php5.conf to this
<IfModule mod_php5.c>
AddHandler application/x-httpd-php .php4
AddHandler application/x-httpd-php .php5
AddHandler pplication/x-httpd-php .php
AddHandler application/x-httpd-php-source .php4s
AddHandler application/x-httpd-php-source .php5s
AddHandler application/x-httpd-php-source .phps
DirectoryIndex index.php4
DirectoryIndex index.php5
DirectoryIndex index.php
</IfModule>
I have done that now, however is still not working. I also uncommented it /etc/mimme.types
But its still not working:confused: Any ideas how to fix this?
Thanks,
Alex
till
7th April 2007, 14:31
You should not put the addhandler directives in /etc/apache2/conf.d/php5.conf, this disables the ability to configure php in ISPConfig. Also uncommenting the mime types will stop ISPConfig from configuring PHP.
Just check the Vhost_ispconfig.conf file if php is enabled in the vhost.
alexillsley
7th April 2007, 16:37
It appears to be set up right in the vhosts files:
###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 192.168.1.10:80
<VirtualHost 192.168.1.10:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: ***********:80
######################################
#
#
<VirtualHost 192.168.1.10:80>
ServerName *****:80
ServerAdmin webmaster@********
DocumentRoot /var/www/web1/web
ServerAlias ********
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web1/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode On
php_admin_value open_basedir /var/www/web1/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web1/phptmp/
php_admin_value session.save_path /var/www/web1/phptmp/
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/web1/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
</VirtualHost>
I dont mind if ispconfig cant stop the scripting, as long as php work then im happy,
Any ideas how to fix this, i really need to get this to work
alexillsley
8th April 2007, 13:24
is there any other files i have to uncomment or is there anything i can do to get php files to work?
falko
8th April 2007, 16:13
Is there maybe a second www.fphosting.co.uk vhost somewhere in your Apache configuration that interferes with this one?
Any errors in Apache's error log?
alexillsley
8th April 2007, 16:48
Nope , unless theres any other files with virtual hosts other than vhosts_ispconfig.conf , i have not manual added any other than ispconfig. I checked that sites error logs and couldnt find any:( i can give you access if you would like to check
alexillsley
8th April 2007, 17:24
I just found the following error in the apache log:
an unkown filter was not added php
I will try reinstalling php
alexillsley
8th April 2007, 17:55
I found out how to stop the error, http://www.howtoforge.com/forums/showthread.php?t=4770&highlight=%24go_info%5B%22server%22%5D%5B%22apache 2_php%22%5D
Though it still doesnt work with php files only php5 files:(
till
8th April 2007, 22:20
I just found the following error in the apache log:
an unkown filter was not added php
I will try reinstalling php
This is just a warning, not a error and it does not affect the execution of PHP scripts at all.
Are you sure that you access the website by its domain and not IP, is the Vhost_ispconfig.conf file included in your apache configuration file? Is mod_php loaded or do you use SuPHP?
alexillsley
8th April 2007, 22:28
Are you sure that you access the website by its domain and not IP
Yep:
removed_now/test.php5 (works)
removed_now/test.php (doesnt work)
is the Vhost_ispconfig.conf file included in your apache configuration file?
Yep:
Include /etc/apache2/vhosts/Vhosts_ispconfig.conf
Is mod_php loaded or do you use SuPHP? I use php not SuPhp where is the files where it loads this?
I can give you vnc /ssh access if you want it just doesnt make sense. I really need this to work:(
Thanks,
Alex
alexillsley
9th April 2007, 01:44
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
It works, there was a spelling a mistake in /etc/apache2/conf.d/php5.conf
I missed the a off application
server1:~ # cat /etc/apache2/conf.d/php5.conf
<IfModule mod_php5.c>
AddHandler application/x-httpd-php .php4
AddHandler application/x-httpd-php .php5
AddHandler pplication/x-httpd-php .php
AddHandler application/x-httpd-php-source .php4s
AddHandler application/x-httpd-php-source .php5s
AddHandler application/x-httpd-php-source .phps
DirectoryIndex index.php4
DirectoryIndex index.php5
DirectoryIndex index.php
</IfModule>
Sorry for wasting your time
Alex
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.