I am trying to install http request class for PHP in windows.
I have downloaded a file here:
http://downloads.php.net/pierre/
php_http-5.3-nts-svn20091125-vc6-x86.zip
However, when I try to enable the extension by adding
extension = php_http.dll to the php.ini, it does not show up in the phpinfo()
Has anyone had any success getting the httprequest class to work in windows.
This is what I am trying to do.
$url = 'http://example.com/';
//create the httprequest object
$httpRequest_OBJ = new httpRequest($url, HTTP_METH_POST);
My guess is that the extension is not in the correct folder, or you have yet to restart your webserver.
If you are using WAMP, make sure that you're editing the php.ini under the apache folder and not the php folder - the latter's php.ini is only used in the command line.
PHP extensions are usually called "php_*.dll" (where the star represents the name of the extension) and they are located under the "PHP\ext" ("PHP\extensions" in PHP 4) folder.
For future reference: http://php.net/manual/en/install.pecl.windows.php
Check the php.ini file under apache/apachex.x.xx/bin/php as well.
This is for those using IIS 7.
The trouble is, that not all of the dll for http request are compatible and therefore wont load. Fortunately I have found the correct one.
This is the httprequest dll, that you need to install for httprequest to work:
http://www.findthatzip-file.com/search-9898866-hZIP/winrar-winzip-download-php-http-5.3-nts-svn20091125-vc9-x86.zip.htm
Related
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.
When I try to load a DLL using the DOTNET() function I get the above error. However, I have .NET installed on my server (I can verify in IIS) and I have also enabled the php_com_dotnet.dll extension in my php.ini file.
This is what it looks like:
[PHP_COM_DOTNET]
extension=php_com_dotnet.dll
However I still get this error. (If it matters, I am not using one of windows's DLL's. It's a 3rd party one that I have obtained)
The reason why i was getting this error is because i was editing the WRONG php.ini file. If you develop PHP in visual studio with the php plugin, you have a separate ini file to work with. It is that one that i had to change to get this to work rather than the .ini file in IIS.
Our system uses a program called PDFlib TET for extracting data from PDF files. The software is installed as a PHP extension.
I have the software working fine outside of CakePHP, I can create a new TET object by calling:
$tet = new TET();
From any file - the extension I am including (php_tet.so) seems to simply work.
However, when I call this from within CakePHP I get the following error:
Class 'TET' not found.
Is there something basic I am missing here?
You have to include the extension in the php.ini file where you're executing the script. Mind that the command line version of PHP (CLI) uses a different php.ini than the webserver by default. E.g. on a recent Ubuntu Linux box, you have to make sure your
extension=php_tet.so
line is included both in /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini.
I'm having problems installing the GD library. I'm using an IIS server with PHP 5.2.14. I uncommented extension=php_gd2.dll in php.ini.
This is the error:
gd: Unable to initialize module
Module compiled with module API =20060613
PHP compiled with modlule API = 20090626
These options need to match
in Unknown on Line 0
I downloaded various PHP versions to try and get the correct DLL, including thread-safe 5.2.14. I would then restart my application pool and try to load a file that uses the GD library. Are there other files necessary for gd2 to work? Are there any quick ways to solve this without reinstalling PHP entirely?
first, iis7 was not configured properly for php - I searched for a guide that walked me through. Second the directory was incorrect, whenever I reset the iis server it originally would say one directory when ISAPI api was being used- but after 2 mins it would say extension_dir was in another directory when cgi/fastcgi is being used. So i created that directory that it wanted (which was different than any of my php.ini's). The one it was pulling from needed to be put in the C:/windows directory, but even though I had it set to go to "./ext" it wanted to go to Program files/PHP-- extremely weird. Third, I had to add IUSR to the permissions of any folder being used.
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