Hi, I did a script for cpanel in php but I want to run it via cron and not via http
If you put
www.site.com/script.php you see the script. Is there a way to block it via htaccess ? and run it in localhost mode??
Thanks
If the script is not designed to be used via a web browser interface, then you can place it outside your public_html directory (so it isn't visible to the public). I'd personally prefer to keep scripts that are not intended for public use outside of public directories so I am not relying on .htaccess etc.
You can then do any number of things. You could make it a shell script by adding the appropriate hashbang to the top and setting executable permissions. Or you could simply call the PHP interpreter with your script as a parameter to have the script executed.