Bug 137443 - PHP5 binary is CGI not CLI
Summary: PHP5 binary is CGI not CLI
Status: RESOLVED FIXED
: 119027 (view as bug list)
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Other (show other bugs)
Version: Final
Hardware: i586 SuSE Linux 10.0
: P5 - None : Major
Target Milestone: ---
Assignee: Petr Ostadal
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 19:10 UTC by Tolan Blundell
Modified: 2006-02-10 18:08 UTC (History)
2 users (show)

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tolan Blundell 2005-12-07 19:10:30 UTC
The is particularly bothersome for me as it breaks all my CLI PHP scripts (the CGI executes in the context of the target script's directory, not the current shell directory).

tolan@twrk:~> php5 -v
PHP 5.0.4 (cgi) (built: Nov 17 2005 20:31:32)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

tolan@twrk:~> php -v
PHP 4.4.0 (cli) (built: Nov 17 2005 20:26:48)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Comment 1 Michael Gross 2005-12-08 16:02:29 UTC
Petr: Does this have a special reason, maby because of the interface? And can this be changed easily by the user? Compiling and using PHP on Apache with CGI is really no good idea... it is awfully slow and uses much ressources...
Comment 2 Cristian Rodríguez 2005-12-12 20:58:54 UTC
I had this problem too.


I fixed it:

open the spec file.
find near the line.. 157x

"Install cli"
replace for:

pushd build-cli
    # make  sure it's the cli version
    make install-cli INSTALL_ROOT=$RPM_BUILD_ROOT PHP_PEAR_PHP_BIN=%{_bindir}/%{name}
    # all the shared modules
    make install-modules INSTALL_ROOT=$RPM_BUILD_ROOT PHP_PEAR_PHP_BIN=%{_bindir}/%{name}
    # pear
    make install-pear INSTALL_ROOT=$RPM_BUILD_ROOT PHP_PEAR_PHP_BIN=%{_bindir}/%{name}
    #devel tools ( php-config , phpize and headers)
    make install-programs INSTALL_ROOT=$RPM_BUILD_ROOT PHP_PEAR_PHP_BIN=%{_bindir}/%{name}
    make install-headers INSTALL_ROOT=$RPM_BUILD_ROOT PHP_PEAR_PHP_BIN=%{_bindir}/%{name}
popd



Comment 3 Cristian Rodríguez 2005-12-12 21:01:53 UTC
BTW.. I only tested that fix on PHP 5.1.2-dev ( CVS)

php5 -v
PHP 5.1.2-dev (cli) (built: Dec 12 2005 17:35:29)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies.
Comment 4 Cristian Rodríguez 2005-12-17 01:02:01 UTC
forget that change. 

the problem it's the spec file is missing --disable-cgi(or maybe --disable-all) at **the end** of  "Build cli" configure line.

since both cli and cgi are enabled by default and both binaries are built with the same name. 
see:

http://cl.php.net/manual/en/features.commandline.php 
Comment 5 Petr Ostadal 2006-01-11 20:51:34 UTC
For stable I fixed it and submited.

Andreas, can I fix it for SL10.0 and have I prepare YOU?
Comment 6 Petr Ostadal 2006-01-11 20:52:17 UTC
*** Bug 119027 has been marked as a duplicate of this bug. ***
Comment 7 Andreas Jaeger 2006-01-12 08:21:52 UTC
Ok for 10.0, swampid is: Maintenance-Tracker-3298
Comment 8 Anja Stock 2006-01-31 12:34:19 UTC
Petr, what is the status here?
Comment 9 Petr Ostadal 2006-01-31 13:28:30 UTC
I have to fix some security bugs in php5 for all distros and I probably fix this bug together with the security update.
Comment 10 Cristian Rodríguez 2006-01-31 16:36:01 UTC
Petr :Nice to know you will fix this on 10.0 too ..the actual binary it's quite annoying,and resource hungry.:-P
Comment 11 Petr Ostadal 2006-02-10 18:08:28 UTC
fixed for 9.3 and 10.0 with security bug #143696