Check out the Red programming language from the same author

PHP support revealed

Nenad Rakocevic - Softinnov
2-Jun-2007 0:07:15 GMT

Article #5
Main page || Index || 3 Comments

If you want/need PHP interfacing with Cheyenne, here are the installation steps to follow :
  1. Download latest PHP binaries for your platform (v5.2.3 at the time this article is written). For the Windows binaries, I've tested only with the .ZIP package, the INSTALLER package may mess up the PHP config, so better stick with the ZIP or TGZ ones.

  2. Unarchive the PHP package where you want, open a shell window and go to the PHP directory. Then launch a PHP session using :

    > php-cgi -b 9999

    Windows users can either use the DOS console or can make a shortcut link to the php-cgi.exe file then edit the properties to add the above startup arguments.

  3. Once your PHP session is up and running, go to your Cheyenne's home directory, then edit the httpd.cfg file, go to the "localhost" domain definition block, then change the root-dir option to indicate the full path of Cheyenne's %www directory. For example, in my config, it looks like this :

    root-dir %/c/dev/cheyenne/www/

  4. Launch Cheyenne and go to the following URL : http://localhost/test.php
    If all goes well, you should see the phpinfo page meaning that the interface is working ok!
You don't have to set anything in the php.ini file to interface with Cheyenne. If you need to allow PHP to connect to a database (like MySQL for example), just edit the php.ini file and uncomment the required extensions (extension=php_mysql for MySQL).

The PHP interfacing is done thanks to the FastCGI protocol. It's currently in alpha state, so don't push it too hard for now. We've tested this interfacing using several popular PHP applications like: phpMySQL, WordPress, GForge, eGroupWare. All worked well as long as you keep a very low traffic (less than 4 simultaneous connections).

More news about the PHP interfacing next week, so stay tuned !


6-Jun-2007 17:58:52
PHP process in FastCGI mode, is limited by default, to a maximum number of served requests (300??), so, in order to make it work more than a few minutes, PHP provides two environment variables to tweak that :
  • PHP_FCGI_MAX_REQUESTS=0, 0 means support an infinite number of requests.
  • PHP_FCGI_CHILDREN=10, max number of child process (or thread?) that PHP will spawn.
Hope this helps.
10-Jun-2007 12:19:36
The root-dir should be same as the doc_root from php.ini (or at least in the sub-folder I guess)
10-Jul-2007 21:28:02
Just a precision about activating the mysql php module, in php.ini, you also have to correctly set the "extension_dir" option. For Windows, it seems to be wrongly set by default to "./". Here's how it should look:

extension_dir = "./ext/"

Post a Comment:

You can post a comment here. Please keep it on-topic.




  Note: HTML tags allowed for:b i u strike li ol ul font a p br pre blockquote

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, personal attacks, offensive blogments, etc.

© Nenad Rakocevic - Softinnov