This is a discussion on 403 Error For PHP Pages within the Apache Web Server forums, part of the Web Server and Related Forums category; Guys, I'm trying to set up apache to work with php. I've been running PHP under IIS for ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Guys,
I'm trying to set up apache to work with php. I've been running PHP under IIS for a while, but I have some Mod_Rewrite rules on my site, and want to play about with them offline. Apache seems ok, service is running. I can get to normal html files, but trying to get to a PHP file give me the old 403 error. Also just noticed this in the error logs : client denied by server configuration: C:/PHP/php-cgi.exe Running XP SP2, PHP5 Thanks, Mark. |
|
|||
|
On reading the php install doc it would seem I need php5apache2.dll -
Can't find it anywhere - Do I need a different version of PHP ?? - couldn't find much on the php.net site. + Still not sure what I do with the current version. starting to get a little confused..... Mark. |
|
|||
|
Ok, now I'm really confused. Relaced my PHP folder with the complete one downloaded from php.net complete with files I need. Did this : For PHP 5: # Add to the end of the LoadModule section LoadModule php5_module "C:/php/php5apache.dll" COULDN'T FIND THE ADDMODULE SECTION : SO DUMPED THE NEXT BIT STRAIGHT AFTER LOADMODULE # Add to the end of the AddModule section AddModule mod_php5.c For both: # Add this line inside the <IfModule mod_mime.c> conditional brace AddType application/x-httpd-php .php DIDN'T KNOW IF i NEEDED THIS NEXT BIT OR NOT : # For syntax highlighted .phps files, also add AddType application/x-httpd-php-source .phps Tried re-starting the Service, but it wasn't having any of it. Took those lines back out, and hey presto the service pops back up. What am I doing wrong ??? Mark. _________________________________________ |
|
|||
|
"MarkP" <mark_paceyuk@yahoo.co.uk> schreef in bericht
news:1165079087.592796.226670@73g2000cwn.googlegro ups.com... > > Ok, now I'm really confused. > > Relaced my PHP folder with the complete one downloaded from php.net > complete with files I need. > > Did this : > > For PHP 5: > # Add to the end of the LoadModule section > LoadModule php5_module "C:/php/php5apache.dll" To add to your confusion .... this module is for apache 1.3 ... > > COULDN'T FIND THE ADDMODULE SECTION : SO DUMPED THE NEXT BIT STRAIGHT > AFTER LOADMODULE > > # Add to the end of the AddModule section > AddModule mod_php5.c .... and this is missing for Apache2 > What am I doing wrong ??? You're cludging with versions. HansH |
|
|||
|
heres a quick example, the module is simply a handler loaded in apache
on startup, you will probably end up putting it inside the apache bin directory. If you really want a quick start apache php startup why not use xampp from apachefriends, it comes preconfigured with mysql too, insecurely for testing, and gets you started. It has mod_perl add on, and is compatible with mod_python and so on and on, at least you will be able to see how the httpd.conf/php.ini etc... is put together properly. <IfModule alias_module> <IfModule mime_module> #these lines you had before probably #ScriptAlias /php/ "C:/path/to/php/" #Action application/x-httpd-php "/php/php-cgi.exe" #heres what you have instead LoadModule php5_module "C:/path/to/the/module/php5apache2.dll" AddType application/x-httpd-php-source .phps #put here the file types you want interpreted by default as php files AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml #this is needed unless you have modified your php.ini #cos <? ?> style is deprecated, and trips up on xml files <Directory "C:/path/to/apache/htdocs/"> <IfModule php5_module> php_admin_flag safe_mode off </IfModule> </Directory> </IfModule alias_module> </IfModule mime_module> you dont have to use all the surrounding if statements but I recommend it since it means you can turn off bits of the server and the conf file can remain the same. Incidentally, there is also a module for iis too, which can be extremely quick, there are a few articles on sing it, (IIS7 with acceleration) but it will work on IIS lesser versions |
|
|||
|
ok, so read the right bit this time :
did this : # For PHP 5 do something like this: LoadModule php5_module "c:/php/php5apache2.dll" AddType application/x-httpd-php .php didn't know where to put this : # configure the path to php.ini PHPIniDir "C:/php" Still couldn't start the service. How can I find which bit is causing me grief ?? |
|
|||
|
MarkP wrote:
> On reading the php install doc it would seem I need php5apache2.dll - > Can't find it anywhere - Do I need a different version of PHP ?? - > couldn't find much on the php.net site. > > + Still not sure what I do with the current version. > > starting to get a little confused..... > > Mark. > Must of not looked to hard. The php5apache2.dll file can be found here at http://www.apachelounge.com/download/ You will find a zip file for it about 1/2 way down the page. (it is across from the paypal button) |
| Thread Tools | |
| Display Modes | |
|
|