Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PHP on Mac OS X (was: (no subject))



Mike,


Am 03.03.2006 um 21:06 schrieb ".Mac account" <email@hidden>:

Hi all,

I have Tiger 10.4.5 and just installed entropy's PHP 4.4.  I have no
problem getting ".../directory_name/" to run correctly without
listing the directory, but if I try "../directory_name/index.php" the
file is treated as text and the code is displayed.   All of the rest
of the site's php files run fine.  Of course, I have all my database
connection info, etc in a configuration file outside of the document
root.  Do I have to modify httpd.conf?

Yes. PHP is part of the standard Mac OS X install but it's not enabled in the Apache configuration.


You need the following in /etc/httpd/httpd.conf:

1) LoadModule php4_module		  libexec/httpd/libphp4.so

2) AddModule mod_php4.c

3) <IfModule mod_dir.c>
<IfModule mod_php4.c>
DirectoryIndex index.html index.htm index.php index.phtml # or something similar
</IfModule>
<IfModule !mod_php4.c>
DirectoryIndex index.html index.htm
</IfModule>
</IfModule>


4) <IfModule mod_php4.c>
	# If php is turned on, we respect .php and .phtml files.
	AddType application/x-httpd-php .php
	AddType application/x-httpd-php .phtml
</IfModule>

Place these in the approriate places in the file.

Note: If you're starting with the default httpd.conf file then you probably just need to uncomment the first two lines, (1) and (2) above, in the file.


HTH Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Web: <http://homepage.mac.com/mike_fischer/index.html> Note: I read this list in digest mode! Send me a private copy for faster responses.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.