- Forums
- PHP
- Warning: Require_once(): Open_basedir Restriction In Effect. File(/usr/share/pear/mail.php)
how to fix error that says warning: require_once(): open_basedir restriction in effect. file(/usr/share/pear/mail.php) is not within the allowed path(s): [2116], Last Updated: Mon Jun 24, 2024
Amin
Fri Feb 01, 2013
0 Comments
763 Visits
if you are reporting an error with your website and you are using IspConfig 3, and your PHP scripts says this error:
Warning: require_once(): open_basedir restriction in effect. File(/usr/share/pear/Mail.php) is not within the allowed path(s): (/var/www/clients/client1/web7/web:/var/www/clients/client1/web7/tmp:/var/www/example.com/web:/srv/www/example.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web7/web/testfiles/email/smtp function/test.php on line 4
Warning: require_once(/usr/share/pear/Mail.php): failed to open stream: Operation not permitted in /var/www/clients/client1/web7/web/testfiles/email/smtp function/test.php on line 4
Fatal error: require_once(): Failed opening required 'Mail.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/clients/client1/web7/web/testfiles/email/smtp function/test.php on line 4
this is what you can do:
1. option 1, if you want all the domains to have the same settings go to the Ispconfig 3 Admin Panel, the go to:
System > Server Config > Select Server > Web (tab) > PHP open_basedir
in the PHP open_basedir field, at the end add this:
:/usr/share/pear/(NOTE: you must put a colon at the beginning)
2. option 2, if you ONLY want to apply this to ONLY ONE website, then go to that website under the Admin Control panel: Sites > Select the Site > Options
under the PHP open_basedir field, add this at the end
:/usr/share/pear/restart your server.
you can use this command to restart you apache server:
/etc/init.d/httpd restart