Openx Market 500 error Fix for cpanel servers
Warning this information may be outdated. Please see the forum for up to date RevMax help and instructions. http://www.openxpayments.com.
At times when I install OpenX on a cpanel server, after log out, then back in, on a new installation, I will receive a error: 500 server error.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
The infamous “500 internal server error” . The server leaving you with no real clues as to what actaully happened,
This is usually caused by permissions defined in
/openx/lib/OX/Plugin/PluginManager.php on line 52 .
Make sure they are defined correctly for your enviroment.
see more for helpful file permissions script.
In hopes of helping others on cpanel servers overcome this openxmarket 777 permissions issue, I took a moment to patch together the code below from snipplr.
If you have experienced the error, and are looking for answers, simply place the below file on your server within the /openx folder and call it in a browser. It will correctly set all folder and file permissions on a cpanle server with suphp. Related post.
Feel free to modify it to use on other files / folders where the permissions should be 755 for folders and 644 for files as needed. It will correctly set all sub directories and file permissions.
copy and paste to new file marketfix.php or other.
<?php error_reporting(E_ALL); require_once 'init.php'; function oxMarketChmod($path, $filePerm=0644, $dirPerm=0755) { // Check if the path exists if(!file_exists($path)) { return(FALSE); } // See whether this is a file if(is_file($path)) { // Chmod the file with our given permissions chmod($path, $filePerm); // If this is a directory... } elseif(is_dir($path)) { // Then get an array of the contents $foldersAndFiles = scandir($path); // Remove "." and ".." from the list $entries = array_slice($foldersAndFiles, 2); // Parse every result... foreach($entries as $entry) { // And call this function again recursively, with the same permissions oxMarketChmod($path."/".$entry, $filePerm, $dirPerm); } // When we are done with the contents of the directory, we chmod the directory itself chmod($path, $dirPerm); } // Everything seemed to work out well, return TRUE return(TRUE); } $plugins = oxMarketChmod(MAX_PATH.'/plugins/etc/oxMarket'); $admin = oxMarketChmod(MAX_PATH.'/www/admin/plugins/oxMarket'); if ($admin == $plugins){ echo "All Done, you can <a href='www/admin/'>login</a> now"; } else { echo 'Something has gone wrong... Perhaps oxMarket dosent exist?'; }?>
Comments
14 Responses to “Openx Market 500 error Fix for cpanel servers”

















WOW,
This is the best fix ever. Thank you soooooooo much for this. I had a previous install of openx that worked fine.
Then i tried a new install with fantastico and found out that for some reason the install wont work.
I then did a manual install and then found this 500 error glitch. I reuploaded and reinstalled like 4 times before finding this. I LOVE THIS BLOG!
Will this always work to set cpanel permissions? Do i just have to edit the values to set permissions on any file on my server?
please feel free to email me a response!
Any folders and files recursively.
within a OpenX environment you could change like:
To set all plugin folders and files to the correct, or script defined permissions, depending on your environment.
Outside of an OpenX environment you would remove the init include at the top of the file, then:
Excellent fix, thanks!
I get this error when I run the script:
Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /”***”/openx/marketfix.php on line 12
Parse error: syntax error, unexpected T_STRING in /”***”/openx/marketfix.php on line 12
This fix worked great! one other thing though – when i log in, openx says my configuration file is not locked even though its chmod 644. do you have any suggestions on how to make this error message go away and successfuly lock this file? spoke to my hosting company and they said try chmod 000. grr, openx can be incredilby frustrating! great post though and thanks, really helped much.
One other thing i would point out is whist your fix works, you will still get 500 errors regarding the plugins. seems this script fixes everything apart from the plugins directory. just a note really.
Perhaps something went wrong with
when poking aroung one soon realizes all the plugin folders and files have incorrect permissions, so perhaps one would want to do
@Steve…
You have to change the chmod to 444 in the cpanel file manager. I dont know why the FTP wont work but it did the same thing for me. Give it a shot and post back.
444 in cpanel file manager works for me, however it seems on some servers when set to 444 the plugins page will load with a few blank lines, and corrupted looking.
That error means you got a stray backslash where PHP doesn’t expect it. Make sure you copied the script as shown. Make sure all comments “//” are double as above and not single “/” as the error indicates.
Hi guys,
Just to say thanks for all the help! 444 in CPanel fixed the locking of the config file.
As for the plugins, i browsed all of the files for each of the default plugins which come with openx (videoads, etc.) and every file in the directories had a 777 permission so simply mass changed every files chmod value in each plugins folder to 755 and they now dont throw 500 internal errors.
My apologies if im rambling, over-tired. Anway thanks again!
Have 1 more question actually, I dont like exposing to the world im running openx but i will obviously have clients who need to log in to the installation, do any of you have any advice on how best to handle this? i normally just htaccess/password an admin directory and it feels a bit un-nerving just leaving openx’s admin directory available for the world to see.
Cheers!
Best to change the above script to do all plugins folders.
client login.
Create advertiser , > advertiser properties > user access.
Create a username and password for them.
Create publisher > publisher properties > user access.
Create a username and password for them.
They can now log into their respective accounts.
Hello
I tried to put the file but i get this error when i call the file in browser
Parse error: syntax error, unexpected $end in /home/*********/ads/www/admin/marketfix.php on line 45
Solved Just change the single file to 755 that it
Thanks
Glad you got it sorted out.