Page 1 of 1

PHP built without CLI SAPI?

Posted: Tue Nov 08, 2005 5:36 pm
by mfichtner
I'm still using PHP 4.3.10, so feel free to yell at me in case this was changed in a later release. ;)

I noticed that the ART PHP package seems to have been built without --enable-cli (or, since it is a 4.3.x release, with --disable-cli). Was that a deliberate decision (for some technical reason), or did you just figure that CLI mode wasn't particularly important in the Plesk environment?

I use PHP for a number of command line tools and cron scripts, and it would make things a bit easier if I could use the CLI SAPI instead of CGI. For example, CLI mode adds some useful constants and overrides some INI directives.

Is there any chance the CLI SAPI could be added for a future release?

PS: I'm on a 3ES server running Plesk 7.5.4.

Posted: Wed Nov 09, 2005 7:54 pm
by scott
Just ran a quick check:

[root@mandarin ~]# rpm -qf `which php`
php-4.4.0-3.rhfc3.art

So its definitely there, I dont have the .spec file handy, but as I recall that the build process puts the CLI together separate from the apache module, so phpinfo() wouldn't return the build options used on that particular component.

Posted: Thu Nov 10, 2005 7:44 am
by mfichtner
I didn't mean to say that the PHP binary isn't there. It definitely is. But it was built for CGI use -- not for the CLI. See the "(cgi)" indicator in the version information:

[root@cgn3 ~]# php --version
PHP 4.3.10 (cgi) (built: Feb 17 2005 09:31:19)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

As I understand it, using "--enable-cli" will build a *second* PHP binary that is optimized for the CLI environment. The PHP documentation has more information on that:

http://www.php.net/features.commandline

Posted: Thu Nov 10, 2005 9:19 am
by scott
Oh gotcha, well I wont be able to do anything until I get the development environment back operational again. I'll add it to the list though.

Posted: Thu Nov 10, 2005 11:48 am
by mfichtner
scott wrote:I'll add it to the list though.
Thanks. :)