no

How to Fix File Access Is Disabled in the Server Configuration

I am checking it my link verifier script is working when I have encountered this error. This is my function that checks if a url is existi...

I am checking it my link verifier script is working when I have encountered this error.

This is my function that checks if a url is existing.


function ipiel_ping_link($obj) {
$flag = 0;
try {
$handle = fopen($obj, "r");

if (!$handle) {
$flag = 0;
} else {
$flag = 1;
fclose($handle);
}
} catch(Exception $e) {
$flag = 0;
}
return $flag;
}


But, it always return the above error. I tested locally and found out that it's working.

Problem: Most web hosting company have strict default value for php setting. Example: allow_url_fopen is default to off. Which is why I have the mentioned error.

Solution:
Create a php.ini in your root directory and just add this line:

[ini]
allow_url_fopen = 1
[/ini]

This will enable file-access.

Related

php 7123581223575980316

Post a Comment Default Comments

item