-
MODX Staff
- 10,725 Posts
You have to have allow_fopen_url enabled on your server to be able to use the function with a URL.
-
☆ A M B ☆
- 24,524 Posts
I found that my server's file_get_contents functionality worked OK on test files.
I would presume that this means that it is enabled.
Yes, I viewed the PHP.ini file and confirmed that allow_url_fopen is set to ON.
I went through the ModX log files as you suggested and here was a typical error entry:
Use of undefined constant E_USER_DEPRECATED - assumed 'E_USER_DEPRECATED'
« MODX Parse Error »
MODX encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error : file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
ErrorType[num] : WARNING[2]
File : /home/--------/public_html/manager/includes/document.parser.class.inc.php(828) : eval()'d code
Line : 13
As is usual, I have no idea what this all means or what I should do about it. Would appreciate more suggestions if there are some. Thanks
-
☆ A M B ☆
- 24,524 Posts
Hm. Try something. Edit the snippet and put this at the very top:
and see what it does. You should see the value of the &p=xyz in your page.
By the way, all of those values should be checked to make sure they are what is expected, such as "p" being an integer. Otherwise nasty people can send URLs with all kinds of nasty things in those values.
I tried this and things changed. The "Error" page no longer displays, which is positive. Instead, it just displays my blank ModX template page, only without the content it should be pulling in.
-
☆ A M B ☆
- 24,524 Posts
Ok, that means that there is something wrong with the snippet. It should display the value of your p=whatever in the URL. What does the Reports -> Error Reports say now?
It no longer generates an error in the log.
-
☆ A M B ☆
- 24,524 Posts
Is there a ?p=whatever in the URL you are using to access the page?
No, but I bet there should be. Right now, the page URL is like this:
www<dot>ourcompany.ca/partners/othercompany.html
No "?p="