PHP SOAP extension not working (PHP + IIS + SOAP Extension) - php

I'm having some issues trying to achieve a SOAP request to a web service by using PHP.
I have a really small project which only send some requests of a SOAP web service, parses them and show the results on a table, but it's not working. I've developed this using XAMPP and this is the very first time I deploy something on a IIS web server so I'm a newbie.
I'm not using any framework, it's just plain PHP.
The first problem I have is that php_soap.dll extension seems to be disabled since I check the configuration with php_info(); and I can't find SOAP extension in the result, but I've enabled it in my php.ini by removing the semicolon from that line and my extension folder is "ext" under my PHP folder. I have some other extensions running and they're just fine.
Doing some var_dump when I try to instatiate the SOAP class, it's not returning anything (not even null).
Some more info:
PHP Version: 7.3.25
IIS Version: 10.0.17763.1 running on Windows Server 2019
2022-09-05 Edit
I've found out that php_openssl.dll isn't working on my server. I don't know why. It's enbled in php.ini. However, phpinfo(); shows it as disabled.
On the other hand, when I run "php -m" command on my CMD, it shows that SOAP and OpenSSL are enabled:

The first thing you need to do is enable the php_soap extension in your php.ini file. You can do this by removing the semicolon from the line that says ;extension=php_soap.dll. Once you have done this, restart your web server.
Next, you need to make sure that the extension_dir setting in your php.ini file points to the directory where your PHP extensions are located. For example, if your extensions are in the c:\php\ext directory, then your extension_dir setting should look like this:
extension_dir = "c:\php\ext"
Once you have done this, restart your web server.
If you still cannot get the SOAP extension to work, please post a comment below and I will try to help you further.

I already solved my problem.
The problem was not in the PHP.ini file, that one was correctly configured.
The problem was that I hadn't installed an extension for PHP and IIS. Once I've installed PHP Manager For IIS and configured it by following this tutorial, it worked out correctly.

Related

Error enabling MongoDB module

I am trying to use MongoDB with drupal 7 site. The database is hosted remotely on mongolab.com.
I have installed the MongoDB Driver on my dedicated server and it added extension = "mongo.so" to my php.ini automatically.
Now, when I try to enable MongoDB module, it gives me this error:
Mongodb requires the PHP MongoDB extension to be installed. (Currently using Mongodb Not found)
Any ideas why?
1) In your phpinfo() screen, make sure the Configuration file Path and Loaded Configuration File match the PHP file you are editing. If not, then find the correct php.ini and add the mongo.so extension.
2) In your phpinfo() screen, look at the extension_dir value and confirm that mongo.so exists in that directory. If not, find the mongo.so file and copy it to this directory.
3) Restart your web server.
4) If it's still not working, take a look at the web server & php logs for clues as to why the extension might not be loading.

configuring curl extension for php in windows

I am using the Xampp server with php5 . I have been trying to get the curl extension working. But, unable to do it. I uncommented the php_curl.dll line in php.ini. I dont see curl enabled in phpinfo() . I also copied the ssleay32.dll and libeay32.dll files to both syswow64 and system32 directories. Do i have to install anything on the server? Has anyone used xampp server before with curl ? thanks
To be honest I did not used XAMPP but couple of times I've faced problems with WAMP extensions on Windows.
Almost always reason was one of the following:
There aren't required file in /ext directory,
Extension line in php.ini is commented,
I forgot to restart server.
Also, this looks interesting (from link #1 below):
There’s a straight-forward XAMPP FAQ
Entry about their php.ini stucture.
For those looking for the easy fix,
ignore everything but the
/apache/bin/php.ini file. That’s the
only one that counts, regardless of
which PHP version you’re currently
using.
What about all the .dll files you
need? Well, you don’t need them.
Everything you need to run CURL on a
XAMPP install is included in the
download. Stop downloading extra crap
and sticking it all over your system.
XAMPP knows what it needs, where it’s
at, and how to use it. End of story.
If above steps doesn't help, read following articles (and comments):
Using CURL in XAMPP
Enable CURL with XAMPP on Windows XP
Enable Curl on Xampp
Getting cURL to Work in XAMPP
Be aware of multiple php.ini files in XAMPP. Be sure that you have edited right one.
P.S. I've just tried to enable cURL in Wamp/XP. I've removed leading semicolon ; from line ;extension=php_curl.dll and restarted server. Now I can see cURL support: enabled in phpinfo() page. I guess that's easy in XAMPP too.

installing php_printer on wamp server

Ive been googling around on how to install the php_printer.dll for wamp server, nothing came up. Perhaps, anyone know how to install that ext? Basically, im trying to use php printer function and i need that extension as i heard. i tried http://www.issociate.de/board/goto/751941/Call_to_undefined_function_printer_open().html to install on wamp server, but still give me error in the webpage? i added the extension: php_printer.dll in php.ini
testing code:
<?php
$filename = "test page";
///////
ob_start();
include $filename;
$contents = ob_get_contents();
ob_end_clean();
///////
$handle = printer_open("HP80AA62");
printer_set_option($handle, PRINTER_MODE, "raw");
printer_write($handle,$contents);
printer_close($handle);
?>
Although I don't have much experience with installing/enabling extensions myself, this has worked for me in the past:
Ensure that php_printer.dll is listed under the "ext" directory inside of your PHP installation. If it isn't there, you will need to download that extension and save it under the "ext" directory.
Add the extension inside of php.ini.
Reboot your server and try again.
Hope that helps,
spryno724
Not
extension: php_printer.dll
You should use
extension=php_printer.dll
Also, be noticed that there are plenty of versions of php_printer.dll and most of them don't work on Windows platform.
Try to get fresh one: pecl-5.2.6-Win32.zip.
Also, consider this line form PHP: Printer manual
Windows users must enable
php_printer.dll inside of php.ini in
order to use these functions. A DLL
for this PECL extension is currently
unavailable.
I've just tried to enable it on Wamp (Windows XP) and it doesn't work.
After enabling the php_printer.dll in your ini, I'd first make sure you did it in the good INI file (by looking at "Loaded Configuration File" in phpinfo()).
Then if proper INI is loaded, but the module still isn't working, I'd go to command prompt and try running php manually, like php -v
That will probably give you an error with some more data on the issue - that error wouldn't be visible anywhere through your browser, that is - when you run a page in browser.
In the end - the error that you'll get reported will most probably be that you are trying to load the module which is compiled as 'thread safe' while your version of PHP was compiled as non-thread safe. Or it will be the other way around.
To overcome that, you'll need to download the proper version of PECL. I think that the link mentioned earlier by Wh1T3h4Ck5 is the thread-safe one.
You can try this link:http://museum.php.net/php5/pecl-5.2.6-nts-Win32.zip or maybe here, it's a bunch of win32 binaries:
http://snaps.php.net/win32/
After you download that, take the printer dll from it, copy to your c:\php\ext (or whatever you use), reset the web server and it should work. If it does well, then the php -v shouldn't give errors any more. You can also use the php -m at that point, to list all the modules loaded, or just check the phpinfo() again.
That was the scenario I had and that's how I solved it.
see the path for "Loaded Configuration File" in your php info page. then add extension=php_printer.dll on that php.ini file. mine, it was "D:\wamp\bin\apache\apache2.4.4\bin\php.ini" at "Loaded Configuration File" on php info page.
after you added, it may give a warning like, php startup: unable to load dynamic library 'path/to/php_printer.dll' - the specified module cannot be found on wamp
I got solved this by changing versions of Apache, PHP and MySQL too. correct versions are:
PHP 5.2.6
MySQL 5.0.45
Apache 2.2.9
Hope this helps.
If you can use xampp 1.6.8 version it will fix these issues. it has php 5.2.6 and also php_printer.dll file has saved in ext folder in php folder. so you will only have to un-comment the line extension=php_printer.dll in php.ini file which noticed in the path under "Loaded Configuration File" section on php info page. you can find that version of xampp from www.oldapps.com

MySQL not working with php; and crashing apache when enabled

I just recently setup a fresh install of PHP, Mysql and Apache on my Windows 2003 server. Php is working fine and my Navicat MySQL browser can connect to my tables. However no matter what I do. MySQL doesn't show in phpInfo() even though I have the extensions in my ext folder. I installed PHP via the windows binary installer. Any idea what I'm missing? I'm pretty new to PHP is this is the first time I've tried to setup my own server I'm sure I'm missing something simple. Thanks.
--- EDIT ---
So as suggested by Alan Geleynse I added the extension to my php.ini, now Apache crashes every time I try to enable php_mysql.dll any ideas on this one? I may just restart my php from scratch if this is any more trouble.
You probably need to enable the extension in your php.ini
Search through php.ini for extension and you should see a list, some of which will be commented out. If you remove the comment for MySQL, it should load the extension.
If you do not see it, you should be able to add this line to your php.ini. Make sure that the dll listed is the one you want and is located in your extension directory.
extension=mysql.dll
Seems the issue was not only a missing php_mysql.dll but I was also missing libmysql.dll The installer still borked the install of the extension files though. Oh well it happens thanks to everyone for the help.
Probably apache crashes because of missing dll. There is probably a directory 'ext' in your php installation dir. Check whether there is a 'php_mysql.dll' file in it.
Also, check for directive 'extension_dir' in your php.ini, it must point to the location of extensions directory. For example, I have php installed in 'C:\php' and 'C:\php\ext' folder in it. My php.ini contains line:
extension_dir = "C:/php/ext"
I just fixed this problem on my computer by copying libMysql.dll from the MySql server directory to c:/windows/system32/, just a few minutes ago.

PostgreSQL trouble on windows PHP

I'm using WAMP on windows, which installs PHP, Apache and MySQL.
I'm now working on something new that requires PostgreSQL. The current install won't do it for me, as I keep getting these errors:
Call to undefined function pg_query()
Always
undefined function
I've installed PostgreSQL 8.3.7-1 for windows, added php_pgsql.dll,php_pdo_pgsql.dll and even libpq.dll, which a note on the PHP page for postgreSQL says Windows users need starting from PHP 5.2.6
Still, I keep getting these errors...
Can someone advise the best course of action? Or should I just uninstall apache and everything else, and do a fresh install of each component seperatly?
xampp doesn't "tell" apache/php which php.ini to use. Therefore php uses its default lookup strategy to find the .ini file. If you haven't changed anything this will be the one in the directory where the apache binary is located, xampp/apache/bin/php.ini. Did you edit this file and removed the semicolon before extension=php_pgsql.dll ?
When in doubt askecho 'php.ini: ', get_cfg_var('cfg_file_path');which file you have to edit.
xampp installs php as a module by default and you have to restart the apache in order to get php to read the php.ini again.
After thatecho extension_loaded('pgsql') ? 'yes':'no';should print yes. If it doesn't stop the apache service, open a command shell, go to your xampp directory and enterapache_start.batThis will start the apache as a console application and you can see startup errors in this console (instead of windows' event manager). If a dll is missing you will get a message box.
Did you enable it in the php ini file?
What does a call to phpinfo() say is installed for extensions?
Depending on what kind of errors you see in the Apache's error.log the answers on this question might be helpful.
I did the same as you did and got rid of the issue.But mine was for xampp. Probably you should re-install your wamp.

Categories