configure php & apache on windows

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeiman
Forum Newbie
Posts: 8
Joined: Wed Jul 17, 2002 5:24 am
Contact:

configure php & apache on windows

Post by jeiman »

Hi, I'm new to php. I running php on windows and using apache as web server. In php.ini, I set my doc_root = myPhp. I can view the phpinfo.php if the phpinfo file is place in myPhp folder. However, if I create subfolder, eg:admin in the myphp folder and I placed file phpinfo.php in the admin folder, when I try to view the phpinfo using web browser http://localhost/admin/phpinfo.php, I get an error the page cannot be found. Why I cannot browse my file in the subfolder of the root folder. Anyone can please help. Thanks
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

Post by lc »

Ok I could be completely wrong but I think I remember that phpinfo only works in the root folder?

You should be able to view other .php documents in deeper folders. Or I know I do ;)
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

Ok, it sounds like the problem is in your httpd.conf. If I understand you correctly, Apache is not using the PHP module to parse files outside the root document directory. What this might mean is that you have put your loadmodule statements inside the <directory ...> xml tag for the root folder. Open up your apache.conf and find the lines that look like:

Code: Select all

LoadModule php4_module c:/php/sapi/php4apache2.dll 

AddType application/x-httpd-php .php .phtml
You should have put these in the file when you installed PHP. Make sure that they are not inside any tag that looks like

Code: Select all

<directory ...>
   ...
</directory>
And let me know if this helped.
jeiman
Forum Newbie
Posts: 8
Joined: Wed Jul 17, 2002 5:24 am
Contact:

Post by jeiman »

Thank you guys. in my httpd.conf, I'm not using Loadmodule but I use ScriptAlias so I can't find loadmodule line. However, I already overcome this problem by using FoxServ, where its includes php, mysql, apache, perl in 1. It easy to install and got control panel too. I love FoxServ very much.
Post Reply