PHP SOAP CLIENT enable - php

I want to use Soap client in my localhost
I edited my php.ini and removed ; from the extention but when I run my code the wrong
Fatal error: Class 'SoapClient' not found in C:\AppServ\www\portal\captiveportal-tc.php on line 41
when I open my phpinfo.php
I see soap
how can I solve it

Related

curl in not getting enabled in php webserver (development)

I am on a windows 10 desktop and I have downloaded PHP 8.1 (8.1.8) from the official website of php. It is located in C:\Program Files\php-8.1.8-Win32-vs16-x64 and I have added it to system path. I have also uncommented the curl php extention in the php.ini-development and php.ini-production files:
My php directory has libcrypto-*.dll, libssl-*.dll and libssh2.dll just like mentioned on php's official website. But even after all that, whenever I try to use the php curl module, I get an error:
Fatal error: Uncaught Error: Call to undefined function curl_init() in .
Also when I save the following code in curl.php file:
<?php
echo "curl enabled: ";
var_dump(extension_loaded("curl"));
?>
and run it using php C:/curl.php, I get:
curl enabled: bool(false)

PHP Fatal error: Class 'IntlDateFormatter' not found in

I recently transferred my magento website from an old server to a new one, and when I opened the home page, it gives me Internal Server Error 500. In the server error log, i can see the following error:
PHP Fatal error: Class 'IntlDateFormatter' not found in /home/evonengc/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93
How can I solve this error?
go to php.ini and enable the extension
;extension=php_intl.dll
to
extension=php_intl.dll
and restart Apache

phpwebsocket - Undefined Function socket_create() - Have php_sockets enabled on Windows/WAMP

I checked out the PhpWebSockets project from here:
https://code.google.com/p/phpwebsocket/
It's in its own project on my localhost (Windows 7 64-bit) box, inside of a WAMP server. I issue the following command in Windows Command Line to run the server.php file:
C:\wamp\bin\php\php5.4.12\php.exe C:\wamp\www\phpwebsocket\server.php
But it results in the following error message:
PHP Fatal error: Call to undefined function socket_create() in C:\wamp\www\phpwebsocket\server.php on line 58
My WAMP instance DOES have the php_sockets extension enabled (since I saw this similar question who had that problem).
Anyone know what I could possibly be doing wrong?
Found the answer in another thread:
Error with PHP Websocket and Wamp Server
Turns out running the file on the command line means it uses a different php.ini file than the WAMP server does. Seems stupid, but turned out php_sockets wasn't uncommented in that php.ini file, and removing it removed the error with it.

Fatal error: Call to undefined function printer_open()

I'm trying to print some string using PHP, i'm using the PHP print functions:
$printer = ("HP LaserJet Professional P1102");
$handler= printer_open($printer);
$content="Test Content";
printer_write($handler, $content);
printer_close($handler);
but I got that error :
Fatal error: Call to undefined function printer_open() in C:\xampp\htdocs\print.php on line 12
after googling it i found that i must add the php_printer.dll to the extensions file in php and add it's extension to the php.ini file, then restarting the server services, all of that accomplished but still getting that error.
p.s. I've tried it on WAMP and XAMPP
I think solution would be extension location.php_printer extension should be stored in c:\xampp\php\ext and not in c:\xampp\php. So move it to the ext-folder, and restart Apache.
Can you look into the error_log, which tells you, if it fails to load the module. You should also run a phpinfo(), which shows up all loaded modules, you must find the printer extensions there.
I hope it may resolve your issue.

apns not connecting in php

i am new to push notifications and tried following to fix this but it still gives same error.
added C:\PHP\ext to the Windows path
added libeay32.dll and ssleay32.dll to C:\WINDOWS\system32\inetsrv
rebooted the server
first error:-
Fatal error: Uncaught exception 'ApnsPHP_Exception' with message 'Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0)' in C:\wamp\www\ApnsPHP-master\ApnsPHP\Abstract.php on line 396
second error:-
ApnsPHP_Exception: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0) in C:\wamp\www\ApnsPHP-master\ApnsPHP\Abstract.php on line 396
i am using a .pem file which was used before somewhere else
and also i am trying to run my file on localhost, does it matter ?
if someone knows something that what should i do to fix this error, then please help me !
and thanx in advance
You should look if SSL is enabled in your configuration.
To display your configuration simply copy/paste the following in some php file and browse to it with a browser:
<?php
phpInfo();
?>

Categories