Jump to content

Warning: simplexml_load_file() [function.simplexml-load-file]


frankbm4

Recommended Posts

I am new to PHP so I am still learning a great deal. I am trying to launch a big site for a client and one feature was produced by another agency using the Google Maps API. Their site worked okay on their server but when moved to mine running PHP5, I started receiving errors. One of the errors was easily fixed when I found out they had misspelled a path. Once that was fixed, I started getting these errors:

 

Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in/homepages/31/d105746882/htdocs/orlando/smilestories/mapzzz.php on line 106

 

Warning: simplexml_load_file(http://maps.google.co.uk/maps/geo?q=135+prosperity+dr.%2C+kitchener%2C+ON%2C+Canada&output=xml&key=ABQIAAAAQhy6LNN-OgxmYTZV8VUafBQ77l1TjQNSMBh8EvFIScgmdn95IRR4yOhgg6hALlqfpDzGZYbA-YNDfA) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in/homepages/31/d105746882/htdocs/orlando/smilestories/mapzzz.php on line 106

 

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://maps.google.co.uk/maps/geo?q=135+prosperity+dr.%2C+kitchener%2C+ON%2C+Canada&output=xml&key=ABQIAAAAQhy6LNN-OgxmYTZV8VUafBQ77l1TjQNSMBh8EvFIScgmdn95IRR4yOhgg6hALlqfpDzGZYbA-YNDfA" in/homepages/31/d105746882/htdocs/orlando/smilestories/mapzzz.php on line 106

 

Unfortunately, because I am using a shared server, I have no access to my php.ini file.

 

Here is line 106: $data=simplexml_load_file($URL);

 

When I view my phpinfo.php file, it tells me that the SimpleXML Support is enabled.

 

I have attached the PHP.

 

I hope someone can help.

 

Thanks in advance.

 

-Frank

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

allow_url_fopen and allow_url_include must be turned on in php.ini (or propriertary .htaccess) before you are able to do this. It was most likely not set up on your server and must be changed by hand.

 

An example .htaccess setup with these values would be:

php_value allow_url_fopen 1
php_value allow_url_include 1

 

This would allow external addresses to be included, Just note the security risks of CSRF and simple file security practises before you enable this.

Link to comment
Share on other sites

allow_url_fopen and allow_url_include must be turned on in php.ini (or propriertary .htaccess) before you are able to do this. It was most likely not set up on your server and must be changed by hand.

 

An example .htaccess setup with these values would be:

php_value allow_url_fopen 1
php_value allow_url_include 1

 

This would allow external addresses to be included, Just note the security risks of CSRF and simple file security practises before you enable this.

 

Hello, Oki.

 

Thanks again for your help. When I changed the .htacess the whole page just showed and error. The actual piece comes is accessed through an iframe yet the whole page showed this error:

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webadmin@kundenserver.de and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

 

I changed that back and learned how to create my on php.ini file and I can see by checking my phpinfo page that the settings are being changed though this.

 

However, after changing my setting in the php.ini to enable allow_url_fopen and  allow_url_include, I get this error:

 

Warning: implode() [function.implode]: Invalid arguments passed in /homepages/31/d105746882/htdocs/orlando/smilestories/mapzzz.php on line 554

 

The previous errors I posted before remain.

 

Thanks for any help.

 

-Frank

 

 

Link to comment
Share on other sites

Oni, your suggestions were correct. I made the changes to the php.ini but it was still not working. Then I realized I needed to move the php.ini file INTO the directory that the the project was in. That fixed it.

 

Thank you very much.

 

-Frank

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.