I have cPanel and I want enable allow_url_fopen
on my host.
When I use this code
if (ini_get("allow_url_fopen") ==1) {
echo "allow_url_fopen is ON";
} else {
echo "allow_url_fopen is OFF";
}
Show me
allow_url_fopen is OFF
I have cPanel and I want enable allow_url_fopen
on my host.
When I use this code
if (ini_get("allow_url_fopen") ==1) {
echo "allow_url_fopen is ON";
} else {
echo "allow_url_fopen is OFF";
}
Show me
allow_url_fopen is OFF
3
Answers
If your PHP version is under 5.4 you can use the following line of code to set allow_url_fopen to true.
You should not enable fopen manually but instead use these commands on the terminal to install a package
Find the path of composer by running this command first:
Install Package after that by using this path:
OR
How to enable or disable allow_url_fopen in cPanel
There are certain scenarios when you may be asked to make changes to your PHP configuration. Specifically, you may be directed to edit a file on your server called php.ini, and to enable or disable allow_url_fopen.
While do not allow direct changes to PHP.ini on our servers. However, PHP configuration changes can be made from cPanel by following these steps:
Log into cPanel.
Look for the SOFTWARE section and click on Select PHP version: cPanel > Software > Select PHP Version
In the new window click on the Switch To PHP Options link : Select PHP Version > Switch to PHP Options.
Here you can locate the allow_url_fopen and tick on the box next to it to enable it or un-tick the box to disable it.
Once you’ll do any change, please do a left-hand side click anywhere outside the dropdown or text input box. If the change was successful, you will see a green box with a message which will confirm that the change has been applied.
That’s all! Now you know how to enable or disable allow_url_fopen in cPanel.