Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > PHP as CGI application

PHP as CGI application
Thread Tools
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Jun 20, 2001, 11:09 AM
 
Can I install PHP as a CGI application on OS X? I'd like to be able to run PHP scripts from the command line. I have the latest PHP version and it has instructions for installing as a dynamic or a static module. Are one of those what I want?
Scott Genevish
scott AT genevish DOT org
     
Mac Elite
Join Date: Sep 2000
Location: Eagan, MN
Status: Offline
Reply With Quote
Jun 20, 2001, 12:31 PM
 
The default installation type for PHP is a CGI executable. Here are installation instructions:

<font face = "courier">wget "http://www.php.net/do_download.php?download_file=php-4.0.5.tar.gz&source_site=www.php.net"
tar xvfz php-4.0.5.tar.gz
cd php-4.0.5
./configure --with-mysql --enable-discard-path --enable-force-cgi-redirect --enable-track-vars
make
sudo make install</font>

You can then write shell-scripts by putting

<font face = "courier">#!/usr/local/bin/php -q</font>

as your script header.

IMPORTANT
There is a slight bug in 4.0.5 that you will have to fix before it will compile successfully. After you configure, open the file main/internal_functions.c and, near the top, you should see a line like this:

<font face = "courier">#include "something"n#include "something"n#include "something"n</font>

You need to correct this so it looks like this:

<font face = "courier">#include "something"
#include "something"
#include "something"</font>


EDIT: posted the wrong header path.

[ 06-20-2001: Message edited by: mr_sonicblue ]
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2