At 15:42 25/01/2008 -0600, Darrick Hartman (lists) wrote: >If you look at the current php5.mk file, the target takes sapi/cgi/php-cgi >and installs it as usr/bin/php. When php builds, it compiles (but does >not install) the cli which is in sapi/cli/php.
I copied sapi/clib/php from the CentOS machine to the AstLinux host as /usr/bin/php-cli, chmod 755, edited test.php to reflect this change but... no luck: I'm still getting some HTML header: ============== # cat /var/lib/asterisk/agi-bin/test.php #!/usr/bin/php-cli -q <?php echo "test"; ?> ============== # ./test.php X-Powered-By: PHP/5.2.5 Content-type: text/html test # ============== # /usr/bin/php-cli -v PHP 5.2.5 (cli) (built: Jan 26 2008 01:22:45) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies ============== # /usr/bin/php -v PHP 5.2.5 (cgi) (built: Jan 26 2008 01:22:44) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies ============== >Unless this is extremely useful, I cannot see us adding it to the standard >build. To me, it is useful because: 1. The language used in Asterisk's extensions.conf is pathetic. Some things are a lot easier when done with external scripts called through the AGI interface 2. Having the command-line version of PHP in addition to the CGI version means that we can use the same language for both usages (extensions.conf and making some information available through PHP pages in the embedded web server). Otherwise, we'll need to add another scripting language like Python. >That being said, we could add it as an optional install. It appears that >most standard distributions install php-cgi as >usr/bin/php-cgi and php(cli) as usr/bin/php. I'm beginning to wonder why >we're installing php-cgi as php? (probably because that's what was >installed in the original buildroot2 tree we started with). We need to do >some researchon this. Fred, it sounds like you're more versed in php >than either Kris or myself. Care to shed some light on this? I'm nowhere near a PHP expert, but I've read that you usually can't rely on the name of the binary: Sometimes /usb/bin/php is the CLI version, sometimes it's the CGI version. The only way to know for sure is to run it with the "-v" switch, like I did above. Ingmar: "All you have to do is to add a couple of lines to the php5.mk file and install the cli version as well into your preferred directory. If you are using unionfs today, you can even just copy the executable over to your existing system and do some initial testing." => Any idea why just copying ./build_i586/php-5.2.5/sapi/cli/php to the CF card as /usr/bin/php-cli still doesn't hide the HTML output, even with the "-q" switch? What specific changes should I make to ./package/php5/php5.mk to build both the CGI and CLI versions? Since Asterisk, Zaptel, PHP/CGI and SQLite are working, being able to call command-line PHP scripts through AGI is the last feature I need to complete my voice server project. Thanks. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Astlinux-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to [EMAIL PROTECTED]
