PHP support revealed
If you want/need PHP interfacing with Cheyenne, here are the installation steps to follow :
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.
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.
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 :
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
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 !
|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 :
Hope this helps.
- 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.
|The root-dir should be same as the doc_root from php.ini (or at least in the sub-folder I guess)
|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.