I was working on a site with OpenX installed today and after doing an upgrade, got the following warning message regarding permissions:
Of course, there was not a list of unwritable files in debug.log, even after deleting the log and re-running maintenance.
So, I did a quick grep to find where that error was coming from:
grep -lnR 'Error: File permission errors detected.' /public_html/openx/ Result: /public_html/openx/lib/OX/Extension/authentication/authentication.php
As you can see, that text is published in authentication.php on line #166, see below:
foreach ($aSysInfo as $env => $vals) { $errDetails = ''; if (is_array($vals['error']) && !empty($vals['error'])) { if ($env == 'PERMS') { // Just note that some file/folders are unwritable and that more information can be found in the debug.log OA_Admin_UI::queueMessage('Error: File permission errors detected.<br />These <em>may</em> impact the accurate delivery of your ads,<br />See the debug.log file for the list of unwritable files', 'global', 'error', 0); } else { foreach ($vals['error'] as $key => $val) { $errDetails .= '<li>' . htmlspecialchars($key) . ' => ' . htmlspecialchars($val) . '</li>'; } phpAds_Die( ' Error: ' . $err, $errDetails ); } } }
In order to better see what was going on, I added “print_r($vals[‘error’]);” to line #5, right after ‘($env == ‘PERMS’) ‘ See below:
foreach ($aSysInfo as $env => $vals) { $errDetails = ''; if (is_array($vals['error']) && !empty($vals['error'])) { if ($env == 'PERMS') { print_r($vals['error']); // Just note that some file/folders are unwritable and that more information can be found in the debug.log OA_Admin_UI::queueMessage('Error: File permission errors detected.<br />These <em>may</em> impact the accurate delivery of your ads,<br />See the debug.log file for the list of unwritable files', 'global', 'error', 0); } else { foreach ($vals['error'] as $key => $val) { $errDetails .= '<li>' . htmlspecialchars($key) . ' => ' . htmlspecialchars($val) . '</li>'; } phpAds_Die( ' Error: ' . $err, $errDetails ); } } }
After logging in and out, I got the error message + the following, which correctly identified the folders with permission errors. I have not seen the error since, just make sure to revert the above changes. Of course, why the plugins folders need write permission still needs to be investigated…
You may need to run the maintence script for it to go away though and or wait for it to run automatically.
/public_html/openx/plugins /public_html/openx/www/admin/plugins /public_html/openx/www/images
OpenX is now know as the Revive Adserver after being sold in September 2013. The above still works though and can help identify missing incorrect permissions.
Comments:
Thanks john, this really help me. The default openx message was not helpful at all and I didn’t want to give openx full 777 permissions.
Thanks for posting this. It also helped me.
This was the ticket! Thanks!
Glad this helped you. I have had to use this process a couple of times to debug openx errors, as the logging mechanism and default reporting leaves something to be desired. Adding the above code is a quick and easy way to see what the issue is.
Something else to check using the above method:
this revealed that the path was not correct (unsure why) for banner storage.
Check Config > Global > Banner Storage Settings – mine was showing a path which did not exist NOT a permission error. Changed to correct path and problem went away.
thx this worked for me
I couldn’t pload a local banner to the webserver
now all works and no error messages
Thank you very much for your solution. It works for my instalation and release me for a lot of headaches!
Great! Thanks a lot John!
Add a Comment