开发者_如何学C
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this questionI want to allow allow_url_fopen
on my server . I have asked my host and they said it can be done with a .htaccess
file. Can anyone tell me how to go about this ?
Try this, but I don't think it will work because you're not supposed to be able to change this
Put this line in an htaccess file in the directory you want the setting to be enabled:
php_value allow_url_fopen On
Note that this setting will only apply to PHP file's in the same directory as the htaccess file.
As an alternative to using url_fopen, try using curl.
allow_url_fopen
is generally set to On.
If it is not On, then you can try two things.
Create an
.htaccess
file and keep it in root folder ( sometimes it may need to place it one step back folder of the root) and paste this code there.php_value allow_url_fopen On
Create a
php.ini
file (for update serverphp5.ini
) and keep it in root folder (sometimes it may need to place it one step back folder of the root) and paste the following code there:allow_url_fopen = On;
I have personally tested the above solutions; they worked for me.
If your host is using suPHP, you can try creating a php.ini
file in the same folder as the script and adding:
allow_url_fopen = On
(you can determine this by creating a file and checking which user it was created under: if you, it's suPHP, if "apache/nobody" or not you, then it's a normal PHP mode. You can also make a script
<?php
echo `id`;
?>
To give the same information, assuming shell_exec
is not a disabled function)
精彩评论