Can' get PHP SOAP enabled - php

I think I have installed SOAP using:
yum install php-soap
However, when I use the following command:
php -i | grep -i soap
I get this error message:
PHP Warning: PHP Start-up: Unable to load dynamic library
'/usr/local/lib/php/extensions/php_soap.dll' - /usr/local/lib/php/extensions/php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0
When I try to install SOAP again, it says it's installed already. In my php.ini file I have uncommitted the line:
extension=php_soap.dll
What am I still missing?
Thanks!
EDIT
Found my .so file with: "find / -name soap.so" (at root)
Then placed that path in my php.ini file.

If you check this answer you might find your clue
how-to-enable-soap-on-centos
You should point to some soap.so library. DLLs are usually on windows. Check your libraries path /usr/local/lib/php/extensions and see if any soap.so library is to be found there

Related

PHP extension dir on Ubuntu

I've just installed the imagick PHP extension following this script: https://gist.github.com/rostockahoi/1d53a2efb8863d72d5f1acb94ae940d1
The install went fine. I found the imagick.so file in /usr/lib/php/20180731 directory. And my php.ini files (fpm and cli) have the extension=imagick.so at the end.
I've restarted PHP and nginx.
Though, PHP cannot find the extension. Look at this CLI test :
$ php -i
$ PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib/php/20170718/imagick.so (/usr/lib/php/20170718/imagick.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/imagick.so.so (/usr/lib/php/20170718/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP is looking for extensions in this directory /usr/lib/php/20170718/
This dir exists but the imagick.so is not in it.
On the other hand, as said before, there is also the directory /usr/lib/php/20180731/ with the imagick.so file in it.
I guess I have to tell PHP to look into the 20180731 dir instead of the 20170718.
How can I do that ?
Or should I copy manually the imagick.so file into 20170718 ? That does not seem optimal...
thanks !
Maybe you should try this php-config --extension-dir
If php-config doesn't exist, then apt-get install php-config
That command will give exact location of your php extension folder.
Don't forget to change your php.ini in order to use extensions.
I finally used another single command to install imagick and everything is fine.
sudo apt-get install php-imagick
The imagick.so has been installed in all /usr/lib/php/YYYYMMDD/ directories.
Much simpler !

homebrew -- Image Magick throwing version error when executing Php

PHP execution is throwing a Warning about Imagick...
Output of php -v:
PHP Warning: Version warning: Imagick was compiled against Image Magick
version #### but version #### is loaded. Imagick will run but may behave
surprisingly in Unknown on line 0
You have certainly upgraded imagick after installing PHP, so you need to reinstall imagick using pecl.
Run the following:
sudo pecl uninstall imagick
sudo pecl install imagick
If you run php -v and see a warning saying that the module imagick was already loaded, check your ini file:
php -i | grep 'Configuration File'
Then open the file and remove duplicate entries of extension="imagick.so". You might need to look into the configuration path to check also other ini files.
php##-imagick needs to be rebottled
brew reinstall --build-bottle php56-imagick
OR
brew reinstall --build-bottle php71-imagick
make sure you use the reinstall command and the proper php## version
Reference to solution on github.com
If you want, you can make the correction by creating a file called ".user.ini" in the root directory of the domain or sub-domain in question and placing the following line inside it:
imagick.skip_version_check = true
The solution is:
Create a file called .user.ini
Type the following into the file.
imagick.skip_version_check=true
Save the file in the top-level folder for the site.

Understanding why PHP does not load an extension

I've compiled PHP from source (5.5.7), as well as the memcached extension (2.2.0). I've installed memcached and the extension is correctly installed in /usr/local/lib/php/extensions/no-debug-non-zts-20121212 (there is the memcached.so file) and my php -i tells me that the extension directory is correct : extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20121212
PHP runs correctly simple files, but when I load an app using memcached, the PHP error log file tells me only PHP Fatal error: Class 'Memcached' not found but I have no more details.
When I run php -m, there is no memcached module listed.
How can I find out why memcached is not loaded by PHP ?
For the record, it's not enough that there is a memcached.so file in the extension_dir of PHP. PHP also needs to extension to be explicitly loaded in the php.init file.
Solved it with the following command
echo 'extension=memcache.so' >> /usr/local/lib/php.ini

Installing Composer OpenSSL Issue

I am trying to install composer however when I go to install it I get this error:
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
I currently have php 5.4.31 and I am running WAMP2.2 I've checked my php.ini file in the bin/php/php5.4.31/ and ensured that the following line is uncommented:
extension=php_openssl.dll
The error still resolves and I'm at a loss as to how I can fix it. As I thought by uncommenting the line it would be enabled.
Also when I run this command in the terminal window php --ini I get the following message:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found
If you are a windows user, make sure to uncomment this line in your php.ini file:
extension_dir = "ext"
It makes sure that PHP is taking the extension from its own ext library.
#Javacadabra, extensions like php_openssl.dll will be under php/ext/ directory, you could fix this path in the config file or you could copy that specific file from php/ext directory to php directory.
in your case it will be c:\php\ext

Trouble Enabling cURL on Ubuntu 11.10

I have installed curl:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
and I have updated my php.ini file to include:
extension=php_curl.dll
I check to see if curl is working with the following command:
php -i | grep curl
and I receive the following message:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' - /usr/lib/php5/20090626+lfs/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Additional .ini files parsed => /etc/php5/cli/conf.d/curl.ini,
curl
I also tested curl by creating a file called testCurl.php which contains the following:
<?php
echo ‘<pre>’;
var_dump(curl_version());
echo ‘</pre>’;
?>
When I navigate to localhost/testCurl.php I get an error: HTTP Error 500
Can anyone help me to get curl working?
You put the wrong info in your php.ini
extension=php_curl.dll
On Ubuntu/Unix that is
extension=php_curl.so
.so means Shared Object, that is a dynamic library the error messages speaks of. On Windows that is .dll, you probably just mixed that.
And it appears you try to load sqlite.so which does not exists. Normally you don't need to change your php.ini file when you install libraries on Ubuntu via apt, because the package scripts take care of that thanks to the work of the package maintainers.
If you'r using Ubuntu or have more than one php.ini you may face this problem of enabling extension=php_curl.dll.
It's curious but I was facing this problem using UBUNTU. For some reason it was calling a .dll file, but linux uses .so files.
First thing to do is echo phpinfo(); in a .php file to check what php.ini is getting loaded.
Configuration File (php.ini) Path /etc/php/7.1/apache2
Loaded Configuration File /etc/php/7.1/apache2/something/php.ini
So if you change only in one file it may not have the correct effect.
In my case whas in /etc/php/7.1/apache2/php.ini and CURL was calling this way:
;extension=curl.dll
Change to
extension=curl.so
Save and restart apache:
sudo systemctl restart apache2
Support for sqlite2 is removed from php5 I think, so sqlite.so is no longer available in the current version of the package. You can manually restore it from the natty packages (this worked for me):
Download the old package from here: http://packages.ubuntu.com/natty-updates/php5-sqlite
Extracts sqlite.so
Move sqlite.so (+pdo_sqlite.so) to /usr/lib/php5/20090626+lfs/
Change file permissions to root:root
(https://lists.ubuntu.com/archives/ubuntu-server-bugs/2011-October/065547.html)

Categories