EIMS FAQ

Question:

How do I use PHP?


Answer

The PHP module that Apple ships/updates with MOSXS is not enabled by default. Enabling it is a simple matter of uncommenting a few lines in the httpd.conf file. (See Configuring Apache for more details)

You must remove the '#' from in front of these lines:

LoadModule php4_module
AddModule mod_php4.c
AddType application/x-httpd-php .php

After doing this, you must restart Apache for the changes to take effect.

To test that PHP is now functioning, create a new document (info.php) in your web directory with the following content:

<?php phpinfo(); ?>

Then with a web browser, call this page up: http://www.yourserver.com/info.php. It should display a full listing of the PHP environment.

PHP also has it's own configuration file (of course) you can use to customize it's environment. As shipped, this file does not exist on MOSXS, so PHP uses it's defaults. PHP expects to find the file here: /usr/lib/php.ini


Be aware that the PHP module that Apple supplies does not have many of the useful features such as PDF/image creation, FTP, curl or ODBC capability. There are several thrid party sources for precompiled PHP modules with support for these features. If you install these modules, you may have trouble updating your server in the future or completely lose the modules since Apple may overwrite them.


You can find more information about PHP at the official site.

You can also visit the MacPHP site to get Mac specific info.


FAQ Home | MacOSXS Home | Page last updated: