|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am running Apache on RedHat Linux 7.0. After setting up my server I made the recommended changes to the httpd.conf.
CGI & PHP should be working. Both have their ScriptAlias set. The problem is that neither work and I keep getting a 403 Forbidden error. Can someone help? Peter |
|
#2
|
|||
|
|||
|
>> CGI & PHP should be working. Both have their ScriptAlias set
Is it mod_php or standalone PHP CGI? If your cgi-bin is scriptalias'ed, you can't put anything other than CGI scripts in it, and its subdirectory recursively. That said, you can't put .htaccess, image, text file, html file, non-cgi.php file there. >> The problem is that neither work and I keep getting a 403 Forbidden error To solve your problem, you gonna need to provide more info in details since there are million of possibilities for your 403 error. |
|
#3
|
|||
|
|||
|
php is using mod_php
I did manage to get cgi working but not php within their ScriptAlias directories. My ScriptAlias for php reads ScriptAlias /php/ "/var/www/php/" Do I need any special permissions set on the php files? peterw |
|
#4
|
|||
|
|||
|
>> ScriptAlias /php/ "/var/www/php/"
The directive ScriptAlias is dedicated for CGI scripts. mod_php's php script IS NOT CGI script. >> Do I need any special permissions set on the php files? Same permission as your plain html files and image files, -rw-r--r-- (644) normally. That said, php script is not CGI script, thus, you don't need to chmod it manually unless your umask is not 022. |
|
#5
|
|||
|
|||
|
If ScriptAlias does not work for php how do you have individual php directories for virtual hosting?
peterw |
|
#6
|
|||
|
|||
|
>> how do you have individual php directories
By default, php is enabled globally and you can run it from anywhere. If you must specify it within a directory, then: 1) Remove this line globally -> AddType application/x-httpd-php .php 2) Add the following: <Directory /www/vhosts/*/htdocs/php> AllowOverride -FileInfo Options All MultiViews <Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND> Order deny,allow Deny from all </LimitExcept> AddType application/x-httpd-php .php </Directory> |
|
#7
|
|||
|
|||
|
thank you for all your help
peterw |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > ScriptAlias |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|