Page 1 of 1
Enabling PHP for certain directories?
Posted: Wed Nov 23, 2005 8:10 pm
by JasonTC
We have a webserver that hosts two websites: taxsale and titlecheck. In a certain directory on our server, the following paths exist:
Code: Select all
taxsale/InetPub/wwwroot
titlecheck/InetPub/wwwroot
The taxsale site is a big program with tons of PHP scripts and the titlecheck site is just static HTML. I designed a new titlecheck site on my local server that uses PHP rather than just HTML.
When I uploaded this new site, I found to my dismay that this directory will apparently not run PHP scripts. When I try to view index.php, I get a "You are not authorized to view this page" error.
One thing I noticed is that all the scripts in the titlecheck/InetPub/wwwroot folder have an "A" in the "Attributes" column, where the scripts in the taxwsale/InetPub/wwwroot folder have nothing in the "Attributes" column.
Does anybody have an idea of what's going on? Even if someone could just tell me what the "Attributes" property means, that might be helpful.
Thanks,
Jason
Posted: Wed Nov 23, 2005 8:41 pm
by Zoxive
Check under one of the options for that folder, and make sure index.php is set be be a default home page. Right now its like default.html, index.html, and some others, but index.php proably isn't one of them : p
-NSF
Posted: Wed Nov 23, 2005 8:49 pm
by JasonTC
Any idea how to get to those settings? I'm very new to server administration.
Also, it doesn't seem like that should even matter for my purposes - I don't care at this time whether or not index.php is the default page for my site. Shouldn't I be able to view any php file by simply typing in the name? That's what I can do on any other server I've worked with.
Thank you,
Jason
Posted: Wed Nov 23, 2005 8:54 pm
by Jenk
If you are using apache, it is possible to use the .htaccess file as a "mini" httpd.conf, by means of specifying the AddType for PHP, have a read here:
http://httpd.apache.org/docs/1.3/howto/htaccess.html
P.S. this should be in the Apache, ISS and webservers forum, not PHP Code

Posted: Wed Nov 23, 2005 9:05 pm
by josh
find httpd.conf (locate httpd.conf in bash), open it up and look for a bunch of lines that begin with "LoadModule"
Add
LoadModule php5_module libexec/libphp5.so
or
LoadModule php4_module libexec/libphp4.so
Then in httpd.conf:
Code: Select all
<Directory /var/www>
# Add this line
AllowOverride All
</Directory>
where /var/www is your documentRoot
then in .htaccess of any directory you want to enable php:
Code: Select all
AddType application/x-httpd-php .php
Posted: Thu Nov 24, 2005 2:10 am
by AGISB
I am not entirely sure here but it might be that your php script need execute permission. HTML just needs read permission to work.
Posted: Thu Nov 24, 2005 8:14 pm
by JasonTC
It's been brought to my attention that this is not the appropriate place for this thread, but since there's already been some ideas thrown around here, I don't want to start over. Hope nobody minds.
I am not entirely sure here but it might be that your php script need execute permission. HTML just needs read permission to work.
I checked the permissions; they all have execute permission.
find httpd.conf (locate httpd.conf in bash), open it up and look for a bunch of lines that begin with "LoadModule"
I searched the server's hard drives for "httpd.conf" - no results.
If you are using apache, it is possible to use the .htaccess file as a "mini" httpd.conf, by means of specifying the AddType for PHP, have a read here:
I visited that link and found it a little confusing. I my server's hard drives for anything containing "htaccess" - it found four files names ".htaccess". Two were in the mail server directory and two were in a folder called phpBB2/cache. Don't know what to make of this.
Posted: Fri Nov 25, 2005 6:41 am
by Chris Corbyn
JasonTC wrote:
find httpd.conf (locate httpd.conf in bash), open it up and look for a bunch of lines that begin with "LoadModule"
I searched the server's hard drives for "httpd.conf" - no results.
That's because it looks like you're not using Apache, you're using IIS.
How did you install PHP? Does it run OK from any other directories within the web root?
EDIT | Also, please post the path on the hard disk to the web root: e.g. C:\www\inetpub\ and also the path you're typing in the URL bar of your browser to access the files

Posted: Fri Nov 25, 2005 12:13 pm
by JasonTC
Yeah, I forgot to mention I'm using IIS, not Apache. Sorry.
I'm not the one who installed PHP on this server - the people who did are conveniently long gone and unavailable for questions.
These are the paths to the two webroots with which I'm concerned:
C:\Program Files\Ensim\Sitedata\taxsale\InetPub\wwwroot (PHP scripts work)
C:\Program Files\Ensim\Sitedata\tcadmin\InetPub\wwwroot (PHP scripts don't work: "Not authorized..." error message)
...and also the path you're typing in the URL bar of your browser to access the files
I actually don't know what this would be. Since our web server is around 1,000 miles away from us, it's faster to work from a local server and then upload to the web server. I've never gone to "
http://localhost" from our webserver or anything like that, if that's what you're asking for.
Thanks,
Jason
Posted: Fri Nov 25, 2005 7:04 pm
by Chris Corbyn
JasonTC wrote:I actually don't know what this would be. Since our web server is around 1,000 miles away from us, it's faster to work from a local server and then upload to the web server. I've never gone to "
http://localhost" from our webserver or anything like that, if that's what you're asking for.
I was but the paths you gave are enough anyway thanks
If static HTML files load (via the web server) from that directory I can't see any reason why PHP would not run on that directory alone. If you have access to install stuff on the server I'd probably have done a reinstall by this point
Reinstalling PHP/IIS on windows is trivial. IIS is done by Control Panel->Add/Remove Programs->Windows Components..... and PHP is a simple binary installer that steps you through it.
I tend to find that you'll get a lot more help and support with Apache though.... It's easier to explain how to configure it since it's text-file based configuration rather than GUI.
Posted: Fri Nov 25, 2005 7:09 pm
by JasonTC
What's the risk of reinstalling PHP (even if it's a degligible one)? I'm new here and I don't want my first "accomplishment" to be screwing up our only server.
Thanks for the help,
Jason
Posted: Fri Nov 25, 2005 9:24 pm
by s.dot
not much of a risk, just read the manual during installation and keep a backup copy of your php.ini file for reference.