I'm been trying to get PHP working with the sqlanywhere.so module and I get the following message. PHP Warning: PHP Startup: Unable to load dynamic library
Sybase Version 7.0
In phpInfo(), it shows that my sqlanywhere.so extension is in the proper extension_dir, and the php.ini file shows that the extension is suppost to be loaded.
I've downloaded the latest module threaded version from the sybase website (ver 5.3.5) threaded and still doesn't work. In addition I've also tried to manually compile the extension and paste into my extension_dir, but get the same error.
Also my LD_LIBRARY_PATH is set in my env and does point to the library files, so when i run say ./dbsrv12 it works.
Please help this is very frustrating
OMG after weeks finally figured it out! PHP is not build in 64 bit, and I was trying to load a 64 bit module to a 32 bit application and of course it won't work. I checked the bit of the extension by using the file command and got this
$ file /usr/local/zend/lib/php_extensions/sqlanywhere.so /usr/local/zend/lib/php_extensions/sqlanywhere.so: Mach-O 64-bit bundle x86_64
Then I used the below way to compile to make 32 bit module instead and ran the file command again and got.
$ file /usr/local/zend/lib/php_extensions/sqlanywhere.so /usr/local/zend/lib/php_extensions/sqlanywhere.so: Mach-O bundle i386
USE The below to complie as 32 bit:
phpize CFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -g -Os' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -g -Os'
./configure --disable-dependancy-tracking --disable-shared -enable-static
I was stumped, but now I see....
answered 23 Mar '11, 14:44
When you say you downloaded the binary for version 5.3.5, it's important to note that the version you download must match the PHP version you have (this is why there are so many versions posted). You indicated that you have PHP version 5.2.17, so you should download the version of our library compiled for PHP version 5.2.17...which I see we don't actually have posted at the moment for some reason (we do have it available if needed).
Anyway, since you're on a Mac, the posted binaries won't work. However, I feel that it's an important point to make.
answered 23 Mar '11, 08:21
I was able to build and load the SQL Anywhere PHP driver on a Mac OS X 10.6.0 machine with the following commands:
You will have to substitute
The last line should produce output similar to:
Admittedly, the specific details in that error message are incorrect for Mac OS X, but the idea is correct.
Once you have this working, it should be fairly easy to get it to work in Apache.
answered 23 Mar '11, 08:44
You say you are using Mac OS X 10.6.6 and that you downloaded a compiled version of the PHP driver from the Sybase website. As far as I know, we do not distribute a compiled version for Mac OS X. You would need to compile it yourself (I see you've done that, so, okay). Also, the library should likely have a .dylib extension on Mac OS X (though I suppose it's possible we're generating .so)
You say you have your
You can get the environment for your apache process (assuming the executable is called
You should see output similar to:
In this example you can see that the environment was reset.
Have a look at these points. If you find that the problem is with the Apache environment, it shouldn't be too difficult to figure out how to push the correct environment variables into the Apache process.