php - using exec to append data to file not in current directory -
i trying set little script allow php append data file
the file etc/httpd/conf/httpd.conf
i want to automatically add data file vhost use...
echo shell_exec('echo "hello" >> /etc/httpd/conf/httpd.conf');
the code not working, , not outputting anything
i have feeling due working directory,
i welcome other ways of doing this... must able called via php window
probably it's permission problem. permissions on httpd.conf? can check using ls -l /etc/httpd/conf/httpd.conf
if you're on linux/mac.