|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
getting php to parse on local server
Not sure if this is the right place for this post or not, but here goes..
I've been using some very simple php includes to simplify management of some sites I have built. With one site I had already uploaded a large number of .html files so rather than renaming them I added the line "AddType application/x-httpd-php .php .htm .html" to the end of the .htaccess file on the web server. With sites I have built since then I just give all the files a .php extension. After getting tired of uploading files to my sites to test them, I decided to enable it on my machine so I could test locally. I am an Oracle DBA by day so I already had apache (oracles version) running on my machine, so I installed the latest php and enabled it in apache. I copied the entire contents & directory structure of two sites to the htdocs folder in the apache directory so that they each have a directory under the htdocs file. Now, my pages I have built in the newer site with a .php extension render fine, with my menu's that are stored in separate.php files showing up as expected. But with the older site that I added the AddType application/x-httpd-php .php .htm .html line to the .htaccess file the php includes are not showing up, despite me adding the neccesary line to the .htaccess file(s) I added the line first to the .htaccess file in the directory where the pages reside, and when that didnt help added the line to the .htaccess file in the root (htdocs) directory. I have been playing around with various suggestions, currently my .htaccess file looks like this: ================================================= # -FrontPage- #IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* AddType application/x-httpd-php5 .php .htm .html AddHandler application/x-httpd-php5 .html .php .htm AddHandler php-script .php .php5 .php4 .php3 .html .htm .phtml ================================================== When I upload the html files to the hosting webserver all is fine, I just cant get it to work on the local machine. I am using php5 What am I missing here? thanks |
|
#2
|
|||
|
|||
|
RE: getting php to parse on local server
Your Apache configuration file, httpd.conf, probably does not allow anything to be overridden in a .htaccess file...
It much easier to find/change the following line in httpd.conf to do this - AddType application/x-httpd-php .php .html |
|
#3
|
|||
|
|||
|
RE: getting php to parse on local server
thanks, been away from this for a couple of days, I'll give your suggestion a try today though..
|
|
#4
|
|||
|
|||
|
RE: getting php to parse on local server
Ok, I added it to the httpd.conf file so it now looks like this:
================================================== ==================== # AddType allows you to tweak mime.types without actually editing it, or to # make certain files to be certain types. # # For example, the PHP 3.x module (not part of the Apache distribution - see # http://www.php.net) will typically use: # #AddType application/x-httpd-php3 .php3 #AddType application/x-httpd-php3-source .phps # # And for PHP 4.x, use: # AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps AddType application/x-httpd-php .php .html AddType application/x-tar .tgz # ================================================== =================== But I am still not getting the php includes parsed in my .html pages. Could it be because I am using php5? Any other suggestions? thanks |
|
#5
|
|||
|
|||
|
RE: getting php to parse on local server
Did you stop and start your web server to get the change to take effect?
|
|
#6
|
|||
|
|||
|
RE: getting php to parse on local server
thanks! that did it - don't know why I didn't even think of that - brain-fart I guess
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > getting php to parse on local server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|