Ramrunner Posted November 16, 2007 Posted November 16, 2007 Hey all, I just installed a new server and have made the switch from ZenCart to OSCommerce on a collegue's recommendation. Installation was flawless, as was deleting the install folder, setting the right permissions on the configure.php (both admin and normal) and enabling a .htaccess on the admin folder. A few days ago, when entering details in the admin section, all was fine. However, today I get a whole bunch of similar errors when I click on the "Modules" section, I include a small exerpt: Warning: include(/var/www/catalog/includes/languages/english/modules/payment/authorizenet.php) [function.include]: failed to open stream: Permission denied in /var/www/catalog/admin/modules.php on line 128 Warning: include() [function.include]: Failed opening '/var/www/catalog/includes/languages/english/modules/payment/authorizenet.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/catalog/admin/modules.php on line 128 Warning: include(/var/www/catalog/includes/languages/english/modules/payment/cc.php) [function.include]: failed to open stream: Permission denied in /var/www/catalog/admin/modules.php on line 128 Warning: include() [function.include]: Failed opening '/var/www/catalog/includes/languages/english/modules/payment/cc.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/catalog/admin/modules.php on line 128 Warning: include(/var/www/catalog/includes/languages/english/modules/payment/chronopay.php) [function.include]: failed to open stream: Permission denied in /var/www/catalog/admin/modules.php on line 128 Warning: include() [function.include]: Failed opening '/var/www/catalog/includes/languages/english/modules/payment/chronopay.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/catalog/admin/modules.php on line 128 Warning: include(/var/www/catalog/includes/languages/english/modules/payment/cod.php) [function.include]: failed to open stream: Permission denied in /var/www/catalog/admin/modules.php on line 128 There's a few more of these but you get the point. Everything else works as advertised. What have I screwed up???? Regards, Ed.
Gauravs Posted November 16, 2007 Posted November 16, 2007 Could you verify what is the code on line 128 in modules.php. Default line is include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file); If it is the same line in your store, echo all variables that you see above (DIR_FSCATALOG_LANGUAGES, $language etc to see which one of them is not correct . .and thus a potential source of error. Also if you could do an echo of PHP_SELF and see how code below would act based on the value should give more insight. <?php 110 $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); 111 $directory_array = array(); 112 if ($dir = @dir($module_directory)) { 113 while ($file = $dir->read()) { 114 if (!is_dir($module_directory . $file)) { 115 if (substr($file, strrpos($file, '.')) == $file_extension) { 116 $directory_array[] = $file; 117 } 118 } 119 } 120 sort($directory_array); 121 $dir->close(); 122 } Duh... I am getting old... could you also review what are the folder and file permissions (644, 0r 755,or xxx) .. appears that the folder doesn't have read permission thus the errors ... points mentioned above still remain valid as a check point though.. Best Regards,Gaurav
Ramrunner Posted November 17, 2007 Author Posted November 17, 2007 Could you verify what is the code on line 128 in modules.php. Default line is include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file); That line is correct, which makes sense because I have not touched modules.php If it is the same line in your store, echo all variables that you see above (DIR_FSCATALOG_LANGUAGES, $language etc to see which one of them is not correct . .and thus a potential source of error. Is this from a root prompt? like 'echo $DIR_FSCATALOG_LANGUAGES' or other? Sorry, I'm a bit lame in that respect. Also if you could do an echo of PHP_SELF and see how code below would act based on the value should give more insight. <?php 110 $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); 111 $directory_array = array(); 112 if ($dir = @dir($module_directory)) { 113 while ($file = $dir->read()) { 114 if (!is_dir($module_directory . $file)) { 115 if (substr($file, strrpos($file, '.')) == $file_extension) { 116 $directory_array[] = $file; 117 } 118 } 119 } 120 sort($directory_array); 121 $dir->close(); 122 } Duh... I am getting old... could you also review what are the folder and file permissions (644, 0r 755,or xxx) .. appears that the folder doesn't have read permission thus the errors ... points mentioned above still remain valid as a check point though.. I'm not sure on how to echo. I do not understand wether you mean at the root prompt or php or whatever. I'm not a php programmer (yet) so if you could give me one example of what you need/are looking for I will get you all I know. As for folder permissions: root@ubuntu:/var/www/catalog/includes/languages/english# ls -al drw-rw-rw- 5 edward edward 4096 2007-07-04 05:47 modules (+ more ofcourse but snipped to keep the post small) folers in there are drw-rw-rw- as well Thanks for the help so far. I cannot imagine I've screwed something up so soon already! I've messed around in index.php to change the standard text, and I've messed around in the admin changing American Dollars to Australian, and doing a bit of localisation stuff, but really nothing that should cause what I'm getting. Regards, Ed.
Ramrunner Posted November 18, 2007 Author Posted November 18, 2007 I'm not sure on how to echo. I do not understand wether you mean at the root prompt or php or whatever. I'm not a php programmer (yet) so if you could give me one example of what you need/are looking for I will get you all I know. As for folder permissions: root@ubuntu:/var/www/catalog/includes/languages/english# ls -al drw-rw-rw- 5 edward edward 4096 2007-07-04 05:47 modules (+ more ofcourse but snipped to keep the post small) folers in there are drw-rw-rw- as well Thanks for the help so far. I cannot imagine I've screwed something up so soon already! I've messed around in index.php to change the standard text, and I've messed around in the admin changing American Dollars to Australian, and doing a bit of localisation stuff, but really nothing that should cause what I'm getting. Regards, Ed. NEVER MIND - GOT IT!!! Permissions on the modules and images folders need to be 0755 (-rwxr-xr-x). BUT, if you could explain why a folder needs to have the execute bit set just for my understanding that would be fantastic. Also, I've never messed with those permissions, so have no idea why they changed. Thank you so much for your help so far. Regards, Ed.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.