Holiday - Promotional Message

open_basedir error in edit module configuration - Holiday - Promotional Message

open_basedir error in edit module configuration

by cut-n-paste » Thu Nov 14, 2024 1:06 pm

I get the following error when trying to configure this module. It seems to be working otherwise and I was able to modify the header text from PhPMySQL. I am hosting on a shared host and don't have access above /usr/www/users/xxxxmhfc/

Code: Select all

Fatal error: Uncaught RuntimeException: SplFileInfo::isFile(): open_basedir restriction in effect. File(/usr/www/users/xxxxmhfc/..) is not within the allowed path(s):

(/usr/www/wwws/users/xxxxmhfc:/usr/wwws/users/xxxxmhfc:/usr/www/users/xxxxmhfc:/usr/home/xxxxmhfc:/usr/local/rmagic:/usr/share/php:/usr/local/lib/php:/tmp:/usr/bin:/usr/local/bin:/usr/local/share/www:/usr/www/share/www:/usr/share/misc:/dev/urandom:/var/www/php_profiler/xhgui) in /usr/www/users/xxxxmhfc/includes/system/versioned/1.0.5.6/page_selection.php:30

Stack trace: 
#0 /usr/www/users/xxxxmhfc/includes/system/versioned/1.0.5.6/page_selection.php(30): SplFileInfo->isFile() 
#1 /usr/www/users/xxxxmhfc/cepadmin/includes/actions/modules/infoboxes/edit.php(20) : eval()'d code(1): page_selection::_edit_pages('index.php', 'MODULE_CONTENT_...') 
#2 /usr/www/users/xxxxmhfc/cepadmin/includes/actions/modules/infoboxes/edit.php(20): eval() 
#3 /usr/www/users/xxxxmhfc/cepadmin/includes/components/infobox.php(15): require('/usr/www/users/...') 
#4 /usr/www/users/xxxxmhfc/cepadmin/modules.php(199): require('/usr/www/users/...') 
#5 {main} thrown in /usr/www/users/xxxxmhfc/includes/system/versioned/1.0.5.6/page_selection.php on line 30
Installed Version: CE Phoenix v1.0.8.20
PHP 8.1
cut-n-paste
Member
Posts: 28
Joined: Fri Oct 07, 2022 12:20 pm
Phoenix Version:
Contact:

Re: open_basedir error in edit module configuration

by raiwa » Thu Nov 14, 2024 6:27 pm

This is not specific to the holiday message module. The error is produced in the core page selection class and will show up in all other modules using it:
#5 {main} thrown in /usr/www/users/xxxxmhfc/includes/system/versioned/1.0.5.6/page_selection.php on line 30
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact:

Re: open_basedir error in edit module configuration

by cut-n-paste » Fri Nov 15, 2024 6:44 am

Interestingly the Store Mode Addon does not throw this error. How can I find out if it does or doesn't use the same core page?

EDIT: on a fresh install I also get a similar error for Store Mode Addon:

Code: Select all

Warning: is_dir(): open_basedir restriction in effect. File(/usr/www/users/xxxxlv/..) is not within the allowed path(s):
 (/usr/www/wwws/users/xxxxlv:/usr/wwws/users/xxxxlv:/usr/www/users/xxxxlv:/usr/home/smallv:/usr/local/rmagic:/usr/share/php:/usr/local/lib/php:/tmp:/usr/bin:/usr/local/bin:/usr/local/share/www:/usr/www/share/www:/usr/share/misc:/dev/urandom:/var/www/php_profiler/xhgui) in /usr/www/users/xxxxlv/includes/modules/content/header/cm_header_store_mode.php on line 203 

Warning: is_dir(): open_basedir restriction in effect. File(/usr/www/users/xxxxlv/..) is not within the allowed path(s):
  (/usr/www/wwws/users/xxxxlv:/usr/wwws/users/xxxxlv:/usr/www/users/xxxxlv:/usr/home/smallv:/usr/local/rmagic:/usr/share/php:/usr/local/lib/php:/tmp:/usr/bin:/usr/local/bin:/usr/local/share/www:/usr/www/share/www:/usr/share/misc:/dev/urandom:/var/www/php_profiler/xhgui) in /usr/www/users/xxxxlv/includes/modules/content/header/cm_header_store_mode.php on line 203
cut-n-paste
Member
Posts: 28
Joined: Fri Oct 07, 2022 12:20 pm
Phoenix Version:
Contact:

Re: open_basedir error in edit module configuration

by raiwa » Fri Nov 15, 2024 9:17 am

Store Mode uses it's own page edit function:

Code: Select all

          'set_func' => "st_store_mode::_edit_pages(",
see module line 192-257:

Code: Select all

    public static function _edit_pages($values, $key) {
meanwhile holiday message and most other modules, including core modules, use the core function:

Code: Select all

          'set_func' => "page_selection::_edit_pages(",
Please post in the public forum for further assistance with your problem. It's a general server configuration issue and not related to this module.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact:

Re: open_basedir error in edit module configuration

by cut-n-paste » Fri Nov 15, 2024 10:55 am

Ok thanks for the help. I will try the public forum even though all other modules seem to be working. Also FYI hashing out the following in cm_header_holiday.php resolves the issue for now except of course for now I would need to modify pages manually.

Code: Select all

//$this->config_key_base . 'PAGES' => [
//          'title' => 'Pages',
//          'value' => 'index.php;product_info.php;shopping_cart.php',
//         'desc' => 'The pages to add the Holiday Message to.',
//         'set_func' => "page_selection::_edit_pages(",
//        'use_func' => 'page_selection::_show_pages',
//],
cut-n-paste
Member
Posts: 28
Joined: Fri Oct 07, 2022 12:20 pm
Phoenix Version:
Contact: