phpcentosincludeopen-basedir

Include file from another domain sam server - 'failed to open stream: Permission denied in /var/www/vhosts/......'


I have build a custom CMS which is stored on a domain and the files are included on other website behind different domains on the same VPS. This way I can update my CMS without having to change every site.

I'm running CentOS7.2 with Plesk 12.5.3 I keep getting the error

'failed to open stream: Permission denied in /var/www/vhosts/......' 'Fatal error: Class 'Language' not found in /var/www/vhosts/....'

What I did so far?

I tested everything in the suggest duplicate url but it's still not working! Can't seem to get it working without any errors.


Solution

  • Check the value of the allow_url_fopen php.ini setting:

    var_dump(ini_get('allow_url_fopen'));
    

    It's probably false. You'll need to either set it to true or ask your web hosting company to do so.

    You could try

    ini_set('allow_url_fopen', 1);
    

    If the value is set to true or On, could you eanble error reporting?

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    

    It can also be usefull to check the /var/log/httpd error log corresponding to your website.