DEV Community

Wajeeh Shaikh
Wajeeh Shaikh

Posted on

Permission denied to write sitemap.xml

I have created a PHP script for my PHP ecommerce website , that whenever I run this script it replaces new sitemap inside sitemap.xml file. this script works great locally but when running this script on live server i got this error:

{warning: file_put_contents(../sitemap.xml): failed to open stream: Permission denied in /var/www/mywwebsite.com/sitemap-maker.php on line 45}

On local machine its working perfectly on apache/xamp, but on live its creating error which is mentioned above. live web server is: Nginx

Top comments (0)