OJS 3 Error logs

Our error log is full of errors:

 [Wed Sep 21 10:07:14.753594 2016] [fcgid:warn] [pid 28443] [client 192.168.131.1:62792] mod_fcgid: stderr: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en_US.js) is not within the allowed path(s): (/var/www/clients/client0/web6/web:/var/www/clients/client0/web6/private:/var/www/clients/client0/web6/tmp:/var/www/migracija.ff.uns.ac.rs/web:/srv/www/migracija.ff.uns.ac.rs/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client0/web6/web/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 567, referer: http://migracija.ff.uns.ac.rs/index.php/gff/management/importexport/plugin/NativeImportExportPlugin
 [Wed Sep 21 10:07:14.753597 2016] [fcgid:warn] [pid 28443] [client 192.168.131.1:62792] mod_fcgid: stderr: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en.js) is not within the allowed path(s): (/var/www/clients/client0/web6/web:/var/www/clients/client0/web6/private:/var/www/clients/client0/web6/tmp:/var/www/migracija.ff.uns.ac.rs/web:/srv/www/migracija.ff.uns.ac.rs/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client0/web6/web/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 567, referer: http://migracija.ff.uns.ac.rs/index.php/gff/management/importexport/plugin/NativeImportExportPlugin
 [Wed Sep 21 10:07:14.753600 2016] [fcgid:warn] [pid 28443] [client 192.168.131.1:62792] mod_fcgid: stderr: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en_US.js) is not within the allowed path(s): (/var/www/clients/client0/web6/web:/var/www/clients/client0/web6/private:/var/www/clients/client0/web6/tmp:/var/www/migracija.ff.uns.ac.rs/web:/srv/www/migracija.ff.uns.ac.rs/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client0/web6/web/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 584, referer: http://migracija.ff.uns.ac.rs/index.php/gff/management/importexport/plugin/NativeImportExportPlugin
 [Wed Sep 21 10:07:14.753603 2016] [fcgid:warn] [pid 28443] [client 192.168.131.1:62792] mod_fcgid: stderr: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en.js) is not within the allowed path(s): (/var/www/clients/client0/web6/web:/var/www/clients/client0/web6/private:/var/www/clients/client0/web6/tmp:/var/www/migracija.ff.uns.ac.rs/web:/srv/www/migracija.ff.uns.ac.rs/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client0/web6/web/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 584, referer: http://migracija.ff.uns.ac.rs/index.php/gff/management/importexport/plugin/NativeImportExportPlugin
 [Wed Sep 21 10:07:14.753605 2016] [fcgid:warn] [pid 28443] [client 192.168.131.1:62792] mod_fcgid: stderr: PHP

Is there a way to get rid of them?

This implies that the call $this->_request->getBasePath() is returning an empty string.

Are you handy with PHP? Can you identify why the code isn’t picking up a valid directory path?

Alternately, could you report what your $_SERVER['SCRIPT_NAME'] variable is defined as?

Hi all,

Note that we’ve seen this once or twice ourselves; I’ll look into it soon and post my results here.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @ctgraham,

Confirming the above warnings on our servers as well.

It looks like $_SERVER[‘SCRIPT_NAME’] is set to ‘/index.php’ (on e.g. the main install page) and the call to PKPRequest::getBasePath is returning an empty string.

Cheers,
Michael

If PKPRequest::getBaseUrl() were guaranteed to return either “” or a relative or absolute path terminated by a “/”, then other path constructions would be $baseUrl . ‘relative/path/to/include’. This, I think, makes more sense than prefixing the include path with a “/”: