Forum Moderators: phranque
This script auto-updates the sitemaps so the sitemap pages must have 666 file permissions in order for the script to update the info from the last run and write the new info. But when any of the files on the server are set to 666, the page will respond with a 500 error when trying to access.
I spoke to the hosting provider and their answer was that their servers are PHPSuExec servers and they require that all files that need to be read by PHP scripts have permissions set to 644, and folders have permissions set to 755.
Would have been nice to know that before I move a 3000+ page site to their server.
I am in need of some info on how to fix or get around this if possible. Either with htaccess or any other source. If anyone know anything about this, PLEASE HELP, the site not working is costing me money.
what do I do with that piece of code?
that is the unix command to change the file mode to 644 for all php files in the /path/to/scripts/ directory.
you would have to get some sort of telnet or ssl application that would give you a command console on the server as well as a login with sufficient priveleges.
I wish I could do that, but unfortunately, the script is encrypted to the point that I wouldn't even know where to start, and it is copyright protected. I hate to post this but I am anyway so you get the full picture. This is a very complicated program and don't think altering the script is possible, and probably not legal. There are over 50 pages like this, and this is the shortest, some cover 4 full page folds. If you know what to do with this, please let me know.
<?php // This file is protected by copyright law and provided under license. Reverse engineering of this file is strictly prohibited.
eval(base64_decode('Pz48P3BocAplY2hvICc8YnI+Q3JlYXRpbmcgSFRNTCBzaXRlbWFwLi4uJztmbHVzaCg
pOwokTHNLUWZXQzdoQ3EybSA9ICRncmFiX3BhcmFtZXRlcnNbJ3hzX2luaXR1cmwnXTsK
aWYoc3Vic3RyX2NvdW50KCRMc0tRZldDN2hDcTJtLCcvJyk+MikKJExzS1FmV0M3aENxM
m0gPSBzdWJzdHIoJExzS1FmV0M3aENxMm0sIDAsIHN0cnJwb3MoJExzS1FmV0M3aENxMm
<snip>
bCwgJ3cnKTsKZndyaXRlKCRwZiwgJHNUT0hrd1kwRWlXaSk7CmZjbG9zZSgkcGYpOwp9C
n0KPz4='));
?>
Lots of crap here so sorry in advance. As you can see, I need another alternative like with htaccess or another script to intercept and change codes back and forth as you implied.
[edited by: jdMorgan at 4:27 pm (utc) on July 10, 2007]
[edit reason] Let's not invite a copyright lawsuit, please. [/edit]
Maybe you can convince the author of the script to sell you an unprotected copy.
Is cron running the script directly or is cron accessing the script via a web server?
Since cron should be running as root, and root should not have a problem writing to a file with 644 privileges, I'm going to presume that you are accessing the script via a webserver using wget or curl. If this is true, and you are running cron on the webserver where the files are hosted, you could change the cron to run a script with the following code:
#!/bin/sh
chmod 666 /path/to/site/map
curl http://example.com/updatescript.php > /dev/null 2>&1
chmod 644 /path/to/sitemap