New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

address error fwrite

Started by alebal, August 04, 2016, 11:15:25 PM

Previous topic - Next topic

alebal

Hi at all.

I have a php file that creates the sitemap. In the end, the file creates a sitemap.xml file in the site root.

$nome_file_index = "sitemap.xml";
chmod($nome_file_index, 0666);
$file = fopen($nome_file_index, "w") ;
fwrite($file, stripslashes(utf8_encode($elenco_sitemap)));
fclose($file);



On cwp this thing does not seem to work ... does not save the file to the root of the site, but in the server root.

Not here /public_html/domain.com/sitemap.xml

But here /sitemap.xml




Something does not work ...

Not only with the sitemap file, but with any file created by php, from any script.

I noticed that if you launch the file manually, everything seems to work correctly.

The file is saved in the wrong place when, for example, is run by crontab.

Missing some configuration cwp? You can solve it without putting hand to all the files already created?

Igor S.

Hello,
if do you want run script from crontab or command line, try t use full  pathes in a scripts.



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services