|
|
php simply won't work - leopard
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2002
Location: Los Angeles
Status:
Offline
|
|
ive replaced the httpd.conf located in /private/etc/apache2 with a fresh one from a fresh install of leopard, removed the # sign before the php5 module, but can't get any php file to load properly in safari.
all im seeing is the code. could somebody please help me out here as i'd like to be able to get php working
thanks
|
| MacBook Pro 2.4Ghz Core 2 Duo | 4GB Memory | 8x DL Superdrive | NVIDIA GeForce 8600M GT graphics with 256MB SDRAM | 160GB Internal running Leopard 10.5.6 | 500GB External | AirportExtreme + Bluetooth 2.0 | Logitech MxRevolution | Casio Exilim EX z75 | iPhone 3G Black |
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Did you add the appropriate PHP Mime types via the "AddType" Apache directive?
[codex]AddType application/x-httpd-php .php[/codex]
You'll probably also want to include index.php in your DirectoryIndex list as well:
[codex]DirectoryIndex index.html index.php index.htm[/codex]
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
I'm assuming you also restarted Apache after modifying your httpd.conf via a:
sudo apachectl graceful
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2002
Location: Los Angeles
Status:
Offline
|
|
sorry, excuse my ineptitudes, but could you tell me how and where to do this?
|
| MacBook Pro 2.4Ghz Core 2 Duo | 4GB Memory | 8x DL Superdrive | NVIDIA GeForce 8600M GT graphics with 256MB SDRAM | 160GB Internal running Leopard 10.5.6 | 500GB External | AirportExtreme + Bluetooth 2.0 | Logitech MxRevolution | Casio Exilim EX z75 | iPhone 3G Black |
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2002
Location: Los Angeles
Status:
Offline
|
|
Last login: Thu Jun 12 20:56:08 on ttys000
Yoav-Weiss-MacBook-Pro:~ yweiss$ apachectl graceful
launchctl: CFURLWriteDataAndPropertiesToResource(/System/Library/LaunchDaemons/org.apache.httpd.plist) failed: -10
Yoav-Weiss-MacBook-Pro:~ yweiss$
|
| MacBook Pro 2.4Ghz Core 2 Duo | 4GB Memory | 8x DL Superdrive | NVIDIA GeForce 8600M GT graphics with 256MB SDRAM | 160GB Internal running Leopard 10.5.6 | 500GB External | AirportExtreme + Bluetooth 2.0 | Logitech MxRevolution | Casio Exilim EX z75 | iPhone 3G Black |
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2002
Location: Los Angeles
Status:
Offline
|
|
ok. i seem to have found the right places...
i added index.htm and index.php to the directoryindex
and i added the addtype bit under the addtype section
the php page seems to load just fine now (when in webserver/documents) !!! thanks so much
but is there a way to get php to load properly no matter where it resides on the system? do i always have to throw it in that directory to view the page?
thanks for all your help
|
| MacBook Pro 2.4Ghz Core 2 Duo | 4GB Memory | 8x DL Superdrive | NVIDIA GeForce 8600M GT graphics with 256MB SDRAM | 160GB Internal running Leopard 10.5.6 | 500GB External | AirportExtreme + Bluetooth 2.0 | Logitech MxRevolution | Casio Exilim EX z75 | iPhone 3G Black |
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by spitty27
ok. i seem to have found the right places...
i added index.htm and index.php to the directoryindex
and i added the addtype bit under the addtype section
the php page seems to load just fine now (when in webserver/documents) !!! thanks so much
but is there a way to get php to load properly no matter where it resides on the system? do i always have to throw it in that directory to view the page?
thanks for all your help
I don't understand your question. PHP is not loaded when you access certain pages, PHP is a language that can be used to interpret and execute PHP webpages access via a web browser (you can also execute PHP scripts via the command line). Now that you have added the PHP module to the list of Apache modules that are loaded whenever the Apache service is loaded/restarted, PHP is loaded into memory and sitting idle until called upon.
Do you mean to ask how do you get PHP webpages to be served from other directories other than what the default is in OS X? If so, this is the "DocumentRoot" directive in httpd.conf. If you change this, you will change the directory where your website is served from.
Alternatively, if you want easy access to this directory from your home directory or something, you can either enable the UserDir Apache module so that you can serve up pages in the form of:
[codex]http://yourdomain/~yourusername[/codex]
Or add a symbolic link (which is virtually the same as an alias in OS X) from your Apache DocumentRoot to a directory in your home directory for easy access - a shortcut, if you will pardon my borrowing a Windows term
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Jun 2007
Status:
Offline
|
|
I've found installer provided by Marc Liyange PHP is as simple as you can get for OSX. I've not really had to muck around the installing process when I went this route.
an even easier approach is to axmp this provides a self contained mysql, php, apache environment. You'll have to adjust the paths and ports since apache is already running. Personally I prefer using the delivered apache and installing php but if you're looking for a development platform xamp can provide a turnkey solution so you can beginning developing and not worry about configuration.
Even though configuration is half the fun
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|