Another one of those web hosting blogs …
PHP Stuff
How to run a PHP script on cron?
First make your your web host allows you to do cronjob. We recommend using ehostpros.com for web hosting.
Look here to see how to setup your own crontab.
If your PHP scripts do not have executable permissions, 644 or -rw-r–r– for example, then as part of the command portion of the cron line, you must specify the php interpreter and pass it the filename of the PHP script (including full path to the script from your home directory) that you want executed, like so:
28 14 * * * /usr/local/bin/php /myscript.phtml
6 3 20 4 * /usr/local/bin/php /htdocs/www/x.php
The first cron line above will run myscript.phtml located in your home directory every day at 2:28PM. The second line will run the script x.php from your /htdocs/www/ directory once a year on April 20th at 3:06AM.
When you explicitly specify the php interpreter /usr/local/bin/php your scripts need not have filenames ending in .php .phtml .php3 .php4. Conversely, if your script filenames do not end in one of those PHP extensions, then you must explicitly use the php interpreter in the command portion of your cron as above.
If your PHP scripts do have executable permissions like 755 or -rwxr-xr-x and they have one of the PHP filename extensions above, then you do not need to specify the php interpreter in the command portion of your cron line, like this:
5 17 * * 2 /myscript.php
The above cron would run myscript.php in your home directory every Tuesday at 5:05PM.
How to disable the safe mode for particular domain
You cannot turn safe_mode off in .htaccess.
You can only change this value in system files (root access needed); php.ini or in <virtualhost> entry in apache’s httpd.conf.
More info: http://www.php.net/features.safe-mode
HOW-TO:
Changing safe_mode to off (or on) in just one domain
edit /usr/local/apache/conf/httpd.conf
find something similar to:
Quote:
<VirtualHost IP.IP.IP.IP>
ServerAlias www.domain.com domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/user/public_html
(…)
</VirtualHost>
of the domain name you wish to change, and palce inside <virtualhost></virtualhost>:
<IfModule mod_php4.c>
php_admin_flag safe_mode off (or on)
</IfModule>
That way, domain.com will have safe_mode disabled (or enabled)
