Opened 17 years ago

Last modified 9 years ago

#13293 closed defect

php5: calling curl_version() results in bus error — at Version 14

Reported by: joe@… Owned by: ryandesign@…
Priority: Normal Milestone:
Component: ports Version: 1.5.0
Keywords: Cc: ryandesign@…, jwa@…, nick-macosforge@…, gage@…
Port: php5-curl

Description (last modified by blb@…)

Most curl functions seem to work normally from php. However, calling curl_version() in a script doesn't work. When called from /opt/local/bin/php, the result is 'Bus error'. When called via FCGI, the php backend dies without output.

OS X 10.4

$ port
MacPorts 1.520

$ /opt/local/bin/php -v
PHP 5.2.5 (cli) (built: Nov 13 2007 18:23:58) 

$ /opt/local/bin/curl -V
curl 7.17.1 (i386-apple-darwin8.10.1) libcurl/7.17.1 zlib/1.2.3
Protocols: tftp ftp telnet dict http file 
Features: Largefile libz 

Change History (15)

Changed 17 years ago by joe@…

Attachment: curl.php added

comment:1 Changed 17 years ago by nox@…

Cc: ryandesign@… jwa@… added
Milestone: Port Bugs

comment:2 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-dev@… to ryandesign@…

comment:3 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

curl_version() seems to return an array, not a string, and it works fine for me, on a MacBook Pro, with Mac OS X 10.4.11, Xcode 2.4.1, MacPorts 1.6.0-rc3, php5 5.2.5_1 and curl 7.17.1_0.

$ /opt/local/bin/php -r 'print_r(curl_version());'
Array
(
    [version_number] => 463105
    [age] => 3
    [features] => 540
    [ssl_version_number] => 0
    [version] => 7.17.1
    [host] => i386-apple-darwin8.10.1
    [ssl_version] => OpenSSL/0.9.8g
    [libz_version] => 1.2.3
    [protocols] => Array
        (
            [0] => tftp
            [1] => ftp
            [2] => telnet
            [3] => dict
            [4] => http
            [5] => file
            [6] => https
            [7] => ftps
        )

)
$

Does this work for you?

comment:4 Changed 17 years ago by joe@…

Same problem as before. 10.4.11 on a MacBook, Xcode 2.4.1

$ /opt/local/bin/php -r 'print_r(curl_version());'
Bus error
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Curious. That should not be! Can you try rebuilding curl and then php5, and then try using curl_version() again?

sudo port -ncuf upgrade curl
sudo port -ncuf upgrade php5

comment:6 Changed 17 years ago by joe@…

No luck, I'm afraid:

$ sudo port -ncuf upgrade curl
Password:
--->  Fetching curl
--->  Verifying checksum(s) for curl
--->  Extracting curl
--->  Configuring curl
--->  Building curl with target all
--->  Staging curl into destroot
--->  Unable to uninstall curl 7.17.1_0+darwin_8, the following ports depend on it:
--->    php5
--->    gimp2
--->    php5
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating curl 7.17.1_0+darwin_8
--->  Uninstalling curl 7.17.1_0+darwin_8
--->  Installing curl 7.17.1_0+darwin_8
--->  Activating curl 7.17.1_0+darwin_8
--->  Cleaning curl
$ sudo port -ncuf upgrade php5
--->  Fetching php5
--->  Verifying checksum(s) for php5
--->  Extracting php5
--->  Configuring php5
--->  Building php5 with target all
--->  Staging php5 into destroot
--->  Unable to uninstall php5 5.2.5_1+darwin_8+fastcgi+macosx+mysql5+pear, the following ports depend on it:
--->    php5-xdebug
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating php5 5.2.5_1+darwin_8+fastcgi+macosx+mysql5+pear
--->  Uninstalling php5 5.2.5_1+darwin_8+fastcgi+macosx+mysql5+pear
--->  Installing php5 5.2.5_1+darwin_8+fastcgi+macosx+mysql5+pear

If this is your first install, you might want
--->  Activating php5 5.2.5_1+darwin_8+fastcgi+macosx+mysql5+pear
--->  Cleaning php5
$ /opt/local/bin/php -r 'print_r(curl_version());'
Bus error

comment:7 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: calling curl_version() from php results in bus errorphp5: calling curl_version() results in bus error

Maybe there's something weird in your configuration? Try backing up your php.ini, then replacing it with php.ini-recommended which is included in the php5 port.

I'm also not sure about this php5-xdebug. But if that's an extension that you load by adding a line to your php.ini, then trying php.ini-recommended should rule that out as well.

comment:8 Changed 17 years ago by joe@…

php5-xdebug is, in fact, an extension loaded by a zend_extension line in php.ini

Unfortunately, running /opt/local/bin/php -r 'print_r(curl_version());' with php.ini-recommended moved to php.ini still produces the bus error.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:9 in reply to:  8 Changed 17 years ago by nick-macosforge@…

I'm seeing this same problem on Leopard (10.5.1) with php5 @5.2.5_1 and curl @7.17.1_0. Anything else that might be of use to try to debug this? Where are the logs from the build of a port stored? Maybe php5 can't find curl for some reason. Thanks!

comment:10 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: nick-macosforge@… added

Nick, MacPorts stores no logs. You could "sudo port -ncufdv upgrade php5" to see the complete build output. You could send everything to a file with "sudo port -ncufdv upgrade php5 &>php5.log" and then examine php5.log for anything curl-related.

Do either of you have anything in /usr/local/lib? If so, try moving /usr/local aside (rename it to /usr/local-off) and reinstall curl and php5 again.

Or, do either of you have Fink installed? Anything in /sw/lib?

Or, do either of you have DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH set?

comment:11 in reply to:  10 Changed 17 years ago by joe@…

Do either of you have anything in /usr/local/lib? If so, try moving /usr/local aside (rename it to /usr/local-off) and reinstall curl and php5 again.

$ ls /usr/local
ls: /usr/local: No such file or directory

Or, do either of you have Fink installed? Anything in /sw/lib?

Never installed Fink.

$ ls /sw
ls: /sw: No such file or directory

Or, do either of you have DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH set?

$ echo $DYLD_LIBRARY_PATH

$ echo $DYLD_FALLBACK_LIBRARY_PATH


comment:12 Changed 16 years ago by gage@…

Has this issue of bus errors occuring when both apache2 and curl are in use been resolved? I am experiencing the same problem when running perl scripts. Scripts that include system calls to curl or to lwp-request cause a bus error.

I am running Leopard (10.5.4) on macbook and am using the apache2, curl and lwp-request downloaded from macports.

Another description of this problem is at http://webwork.maa.org/moodle/mod/forum/discuss.php?d=6043

I have seen similar reports dating from November 2007 about macports and the (then new ) leopard installation. I have also seen reports from debian builds from earlier years that were fixed by "upgrading to the newest release". Unfortunately I wasn't able to find any details about the fix.

Thank you for your attention.

Take care,

Mike Gage

  1. of Rochester

comment:13 in reply to:  12 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: gage@… added

Replying to gage@math.rochester.edu:

Has this issue of bus errors occuring when both apache2 and curl are in use been resolved? I am experiencing the same problem when running perl scripts. Scripts that include system calls to curl or to lwp-request cause a bus error.

I still cannot reproduce this problem on my systems, either with 10.4.11 or 10.5.4. If you can attach a minimal perl script which I can run on my systems to see the problem, I can attempt to look into this further.

comment:14 Changed 16 years ago by blb@…

Description: modified (diff)
Keywords: php removed
Port: php5 added

Is anyone still seeing this, I can't reproduce either? If it is still an issue for someone, interesting information would include the output from

otool -L /opt/local/bin/php

and

otool -L /opt/local/lib/libcurl.dylib
Note: See TracTickets for help on using tickets.