Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old February 27th, 2007, 10:59 PM
Glen_S Glen_S is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Lac La Biche, Alberta, Canada
Posts: 10 Glen_S User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 35 m 7 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old February 28th, 2007, 12:50 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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




Reply With Quote
  #3  
Old March 1st, 2007, 01:18 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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..

Reply With Quote
  #4  
Old March 1st, 2007, 05:12 PM
Glen_S Glen_S is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Lac La Biche, Alberta, Canada
Posts: 10 Glen_S User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 35 m 7 sec
Reputation Power: 0
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

Reply With Quote
  #5  
Old March 1st, 2007, 06:10 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: getting php to parse on local server

Did you stop and start your web server to get the change to take effect?

Reply With Quote
  #6  
Old March 1st, 2007, 06:54 PM
Glen_S Glen_S is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Lac La Biche, Alberta, Canada
Posts: 10 Glen_S User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 35 m 7 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > getting php to parse on local server


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway