I use http_get function in my php code. When I tr to run the php page on browser I get the next message : Fatal error: Call to undefined function http_get() But when I run my php script from command line there isn't any error message and it works fine. Can somebody help what would be the problem ?
Here it is. It just get a xml from a server. From command line I get the xml as result. <?php echo "Start"; $keres = http_get("https://x.x.x.x/reports.asp" , array("httpauth" => "userassword")); $valasz_body = http_parse_message($keres)->body; echo $valasz_body; echo "End"; ?>
That's what I meant, neither the http_get() nor http_parse_message() functions are defined. These are not built-in functions. Where are these functions defined? Include() this file.
http_get() is in the php_http.dll extension. But as I mentioned, from command prompt the script works correctly so knows this function. Would be the Web server (Apache) faulty maybe ?
The problem is resolved. I noticed on the apache error log this message : Unable to load dynamic library php_http.dll - the specified modul could not be found. However the php_http.dll was the right directory and the setting of the extension_dir was right too. I tried to reinstall apache but it didn't help. I spent a lot of hours to find solution on the web and it seems hundreds and hundreds noticed this bug too but I couldn't find any solution. I used Apsserv 2.5.8 (l tried 2.5.9 too) package with PHP 5.2.3 and Apache 2.2.4. At the and I unistalled Appserv and downloaded PHP 5.2.4 and Apache 2.2.4. After the installation my script worked perfectly.