enable allow_url_fopen

Status
Not open for further replies.

biscoolcool

New Member
Messages
53
Reaction score
0
Points
0
I read how to enable allow_url_fopen it said I need to go to http://x10hosting.com/panel.php sign in, go to "Upgrade PHP Version" and select "Intermediate". When I go there I get this message "This feature is not currently activated on your account. All accounts are set to x10Hosting's PHP v2. If you are not sure what that means, don't worry about it." How do I enable it?

Thanks
sshot4h.png


sshot5.png
 
Last edited:

zen-r

Active Member
Messages
1,937
Reaction score
3
Points
38
Well don't worry.

As was written for you , all accounts are already set to intermediate level PHP. So you can't, & don't need to upgrade. This change was made after the server upgrades a couple of months ago, & we don't seem to have gone back to the old system of having to request PHP upgrades (yet, anyway).

The thread you had read was out of date. :)
 

biscoolcool

New Member
Messages
53
Reaction score
0
Points
0
Why does the first image say that I have PHP version 1 and the second image say PHP version 2?
Edit:
Well don't worry.

As was written for you , all accounts are already set to intermediate level PHP. So you can't, & don't need to upgrade. This change was made after the server upgrades a couple of months ago, & we don't seem to have gone back to the old system of having to request PHP upgrades (yet, anyway).

The thread you had read was out of date. :)

According do you my account is set to intermediate and allow_url_fopen is enabled.

Then why do I get this error on my site?

sshot6.png
 
Last edited:

allofus

New Member
Messages
183
Reaction score
2
Points
0
I had this issue a short while back, am on a paid hosting account and I recall being advised to use curl instead.

Some mention of a security risk or something.

I looked to curl and it made no sense to me so i lazily decided to use an iframe with a javascript that ammends the height related to the content.

Not the better solution I suppose but it does work.


PHP:
<script language="JavaScript">
<!--
function frameheight()
{
var the_height=document.getElementById('some_name').contentWindow.document.body.scrollHeight;
document.getElementById('some_name').height=the_height;
}
//-->
</script>

<iframe width="100%" 
id="some_name" 
onload="frameheight();" 
src="http://your_url" 
scrolling="no" 
frameborder="0" 
height="1">
Oops, &quot;IFRAMES&quot; are not working.
</iframe>
 

biscoolcool

New Member
Messages
53
Reaction score
0
Points
0
Thanks I'll use that for now but I still need allow_url_fopen to work.
Anybody got another idea?
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
you could try cURL or a client (iFrame or JS) method until url_fopen is re-enabled.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
I am on Chopin and I can use fopen and file_get_contents on urls.
 
Last edited:

biscoolcool

New Member
Messages
53
Reaction score
0
Points
0
Probably because you switched to php intermediate. My problem is that the 1st img says that I have php V1 and the second says I have v2.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Probably because you switched to php intermediate. My problem is that the 1st img says that I have php V1 and the second says I have v2.

I did not switch.
My screens say the same as yours do.
 

biscoolcool

New Member
Messages
53
Reaction score
0
Points
0
I did not switch.
My screens say the same as yours do.

Remember the translator? Misson told me I can include it on every page using this code
PHP:
<?php include('translator.php'); ?>

It dosen't matter how but I figured out to use the code with the http:// I need url_fopen to be enabled.
PHP:
<?php include('http://mywebsite.co.cc/translator.php'); ?>

So if I use this code on my localhost (my own computer) every thing work but if I put this code on my website (with a page including the translator I get this error:

Code:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/biscool/public_html/index.php on line 52

Warning: include(http://mywebsite.co.cc/includes/php/translator.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/biscool/public_html/index.php on line 52

Warning: include() [function.include]: Failed opening 'http://mywebsite.co.cc/includes/php/translator.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/biscool/public_html/index.php on line 52

but if you go on http://mywebsite.co.cc/includes/php/translator.php evrything work fine.

Did I do something wrong? Got another way of doing this using php?

Thanks
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Including a script over HTTP is almost always the wrong thing. If you include a file using URL wrappers, the script will fetch the page using HTTP, which means it gets the processed output of the included page. If the included page printed a PHP script, this would probably work, but translator.php prints just HTML. translator.php needs to execute in the context of the including script so it has the right value for $_SERVER['SCRIPT_URI']. If you include translator.php over HTTP, $_SERVER['SCRIPT_URI'] will refer to translator.php, and you'll get a translator widget that will translate only translator.php.

If you want to include files relative to the document root, use $_SERVER['DOCUMENT_ROOT'] (as recommended in the previous discussion) or virtual() instead of include(). Note that virtual() only works under Apache and incurs a slight performance hit as it requires a sub-request.

Don't put the includes folder in public_html; put it one level up, so it's a sibling of public_html.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
allow_url_fopen is enabled.

But allow_url_include is disabled.

Why not host the included file locally? Is it your file?
 

biscoolcool

New Member
Messages
53
Reaction score
0
Points
0
Thank you so much for explaining everything!!! I'm still only learning php so this is why I made the mistakes like include the translator thought HTTP.
 
Status
Not open for further replies.
Top