php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19322 system() call returns undefined function w/Apache-2.0.40
Submitted: 2002-09-09 15:02 UTC Modified: 2002-10-09 16:52 UTC
From: danne at wiberg dot nu Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4.2.3 OS: FreeBSD 4.6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: danne at wiberg dot nu
New email:
PHP Version: OS:

 

 [2002-09-09 15:02 UTC] danne at wiberg dot nu
system() returns undefined function, but exec(), passthrou() and the backtick operator works. Running Apache-2.0.40.

Compile info:

System FreeBSD mspiggy.wiberg.nu 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #0: Sun Aug 25 20:08:18 CEST 2002 root@mspiggy.wiberg.nu:/usr/src/sys/compile/MSPIGGY i386
Build Date Sep 9 2002 19:44:44
Configure Command './configure' '--with-apxs2=/usr/local/sbin/apxs' '--with-tsrm-pth' '--with-config-file-path=/usr/local/etc' '--enable-versioning' '--with-regex=system' '--without-gd' '--without-mysql' '--with-gd=/usr/local' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-zlib' '--with-bz2=/usr' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-pdflib=/usr/local' '--with-zlib-dir=/usr' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-tiff-dir=/usr/local' '--with-imap=/usr/local' '--with-mysql=/usr/local' '--with-ldap=/usr/local' '--with-openssl=/usr' '--with-snmp=/usr/local' '--enable-ucd-snmp-hack' '--with-openssl=/usr' '--with-expat-dir=/usr/local' '--enable-ftp' '--with-iconv=/usr/local' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-trans-sid' '--prefix=/usr/local' 'i386-portbld-freebsd4.6.2'
Server API Apache 2.0 Filter
Virtual Directory Support enabled
Configuration File (php.ini) Path /usr/local/etc/php.ini
Debug Build no
Thread Safety enabled

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-09 17:25 UTC] sniper@php.net
Can you please attach a sample script here which shows this problem?  Somehow I doubt this has anything to do with Apache2..but could you check if compiling a CGI and running the test script with it does the same?

 [2002-09-10 00:15 UTC] danne at wiberg dot nu
My script:
<?
$command='/sbin/ping -c 1 www.sunet.se';
passthru($command); /* This works */
exec($command); /* This works */
system($command); /* This gives undefined function */
?>
My output:
PING www.sunet.se (192.36.125.18): 56 data bytes 64 bytes from 192.36.125.18: icmp_seq=0 ttl=247 time=14.091 ms --- www.sunet.se ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 14.091/14.091/14.091/0.000 ms
Fatal error: Call to undefined function: system() in /usr/local/www/data-dist/test.php on line 8
 [2002-09-10 00:26 UTC] danne at wiberg dot nu
I just compiled php standalone, it worked, no undefined function.
 [2002-09-10 19:48 UTC] sniper@php.net
Can you try compiling a new apache2 module from _clean_ sources (fresh download from www.php.net :) and only include
the minimum amount of configure options. (ie. just the --with-apxs2 one)

 [2002-09-11 00:18 UTC] danne at wiberg dot nu
+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| In order to build PHP as a Apache2 module on FreeBSD, you have to  |
| add  --with-tsrm-pth to your ./configure line. Therefore you need  |
| to install gnu-pth from /usr/ports/devel/pth.                      |
+--------------------------------------------------------------------+
Should I include this also?
 [2002-09-11 00:50 UTC] danne at wiberg dot nu
Using --with-apxs2 --with-tsrm-pth

same problem.

Only --with-apxs2 doesn't work, se below:

Syntax error on line 273 of /usr/local/etc/apache2/httpd.conf:
Cannot load /usr/local/libexec/apache2/libphp4.so into server: /usr/local/libexec/apache2/libphp4.so: Undefined symbol "pthread_getspecific"
 [2002-09-11 08:23 UTC] sniper@php.net
So it's yet another apache2 problem then.
Could you also try this snapshot:

http://snaps.php.net/php4-latest.tar.gz
 [2002-09-11 16:47 UTC] danne at wiberg dot nu
./configure --with-apxs2
[loads of suff]
checking for Berkeley DB2 support... no
./configure: 21429: Syntax error: "fi" unexpected (expecting "then")
 [2002-09-11 17:03 UTC] danne at wiberg dot nu
Trying php4-200209111200:
make install
[a lot of output]
[PEAR] Archive_Tar    - installed: 0.9
[PEAR] Console_Getopt - installed: 0.11
[PEAR] PEAR           - installed: 0.91
Segmentation fault - core dumped
*** Error code 139

Stop in /usr/home/danne/tmp/php4-200209111200.
*** Error code 1
 [2002-09-14 02:41 UTC] danne at wiberg dot nu
The PHP installation segfaults, but when I compile it against Apache2 I don't get an executable, so how do I debug it?
 [2002-10-05 02:57 UTC] sander@php.net
Yeah, it does that sometimes... just try make install again.
 [2002-10-08 06:13 UTC] danne at wiberg dot nu
Yes, I've tried daily since Sep 14:th. Same coredump. Would be nice if I could contribute with something useful or work around the problem.
 [2002-10-08 22:26 UTC] iliaa@php.net
Are you able to successfuly complete the make install if you add --without-pear to your confgure line?
 [2002-10-09 16:41 UTC] danne at wiberg dot nu
Tried it and it worked well, I've tried a few applications (squirrelmail, gallery) under this build and it works fine.

But the main thing: system() works!

Thanks a lot, case closed!
 [2002-10-09 16:52 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

user reports that problem has been fixed.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 17 17:05:44 2022 UTC