Crontab To Run PHP [without Using Wget And Lynx]
Hello, I don't know how to use crontab to run PHP without using wget and lynx
1) The PHP script can run via SSH command line mode without problem
2) I can use crontab to run the PHP script with wget or lynx.
However,
3) The script will not run if i using below entry
1 2 * * * php /path/to/script/crontest.php
1 2 * * * php -q /path/to/script/crontest.php
1 2 * * * php -f /path/to/script/crontest.php
1 2 * * * /usr/local/bin/php - /path/to/script/crontest.php
1 2 * * * /usr/local/bin/php -f /path/to/script/crontest.php
1 2 * * * /usr/local/bin/php -q /path/to/script/crontest.php
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
How Does One Run Crontab Effectively?
How does one get their cron jobs emailed to them? How does one run crontab effectively? I have been trying to start up a new cronjob. I wrote the line command chmoded it to 755 and put it in a folder cron.x In my crontab I input the following: 30 23 * * * root run-parts /etc/cron.x the first is minutes the second hours, right? At 23:30 on my server time, nothing happened. >_<;; I'd like to have my cronjobs emailed to me so that if there is an error, I can see it. I've been combing google with little avail (can't find much other than unrelated blog junk on that engine nowadays anyway >_<) I figured WHT would be more useful.
View Replies!
View Related
Crontab + Php In Freebsd 6.1
i created a new cron job with "crontab -e" command by using the "root" user. * * * * * php -f /path/file.php i tried it for php -q too. while i type this command on the shell the php file works. there is no problem with crontab rule too. the chmod of file.php is 777, user root group wheel.. but it cant work. i couldnt understand why it aint. i created a shell file and changed the cron like: * * * * * /path/file.sh and in file.sh: #!/bin/sh php -q /path/file.php mkdir /path/anydir so, /path/anydir have been created but file.php not executed. so the problem is not about cron rule.
View Replies!
View Related
Pico Etc/crontab VS Crontab -e
I have been searching for an answer on this for a couple of days and have yet to find one. I am running a box with Centos. If I Pico etc/crontab I get this type of output; SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly If I crontab -e I get this type of output; 44 21 * * * /scripts/upcp 0 1 * * * /scripts/cpbackup */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 2,58 * * * * /usr/local/bandmin/bandmin 0 0 * * * /usr/local/bandmin/ipaddrmap Why different? I am taking it crontab using -e is not the same file as etc/crontab?
View Replies!
View Related
Cron: How To Run Php File
My server with cPanel, I'd like run file http://domain.com/file.php at 0h00 everyday, I have set the Cron Job in cPanel : Code: 0 0 * * * /usr/bin/ehpwget http://domain.com/file.php but The cron is not working well Code: /bin/sh: /usr/bin/ehpwget: No such file or directory Can any one please let me know how to run a php file with cron. (as user or root)
View Replies!
View Related
Cron Run Php Scripts
I have my own server. I create php file for adding cronjobs. I checked /etc/cron.deny and /etc/cron.allow. both of them is empty so no problem. I execute the php script but nothing : I check with crontab -u user l and it told me no cronjobs for that user. When I access as root from ssh and try teh same command, it works fine. I don't understand how to fix that.
View Replies!
View Related
Get PHP To Run On Windows Host
I want to get PHP to run on Windows webhost. The webhost is not able to run a simple PHP file with phpinfo() yet. Tech support says I can use .htaccess to get PHP to run. What is the best way to setup PHP on Windows Host so that it can run Joomla?
View Replies!
View Related
How To Run PHP 4 And 5 In Ubuntu Without CGI
When we chose Symfony to implement [url], PHP 5 was needed but we only had PHP 4 installed in our Ubuntu hosting servers. We couldn¡¯t just migrate everyone to PHP 5 since some of client¡¯s applications were incompatible with PHP 5. Some tutorials were found online explaining how to run PHP 4 and PHP 5 simultaneously such as [url] and [url]but they all used CGI. As you probably know, CGI is not scalable and we needed to scale in PHP4 and PHP5 since we needed to server millions of hits in both configurations. The following are additional the requirements we had: 1. Run Apache 2. Use mod_php for both PHP versions. 3. Run eAccelerator with both PHP versions. 4. Use as many Ubuntu packages as possible to ease maintenance issues and easily deploy on multiple servers. 5. Use Ubuntu 6.06.1 LTS The solution we came up with was to run Apache 2 with PHP 5 and run Apache 1 with PHP 4 on separate IPs. Ubuntu comes already with these packages. The only package we had to compile was eAccelerator. The following lists the steps taken to get this setup: Apache 2 with PHP 5 * apt-get install apache2 libapache2-mod-php5 php5 php5-cli php5-curl php5-gd php5-mysql php5-dev make php5-mcrypt php5-imap * vi /etc/php5/cli/php.ini and uncomment extension=mysql.so * vi /etc/apache2/ports.conf and put Listen Your.IP.Goes.Here:80 * a2enmod expires * vi /etc/apache2/conf.d/hosting <VirtualHost *> DocumentRoot /home/httpd/mainpage ServerName mainpage.com ServerAlias www.mainpage.com Options Includes FollowSymlinks AddType application/x-httpd-php .php DirectoryIndex index.php index.html index.htm </VirtualHost># Cache images and javascripts ExpiresActive on ExpiresByType image/gif ¡°access plus 1 week¡± ExpiresByType image/jpeg ¡°access plus 1 week¡± ExpiresByType image/png ¡°access plus 1 week¡± ExpiresByType image/x-icon ¡°access plus 4 week¡± ExpiresByType application/x-javascript ¡°access plus 4 week¡± ExpiresByType application/x-shockwave-flash ¡°access plus 4 week¡± * cd /usr/local/src * wget http://bart.eaccelerator.net/source/...-0.9.5.tar.bz2 * tar xjvf eaccelerator-0.9.5.tar.bz2 * cd eaccelerator-0.9.5/ * phpize5 * ./configure * make * make install * mkdir /var/tmp/{eaccelerator4,eaccelerator5} * chown www-data /var/tmp/eaccelerator* * chmod 700 /var/tmp/eaccelerator* * vi /etc/php5/apache2/php.ini and add the following: zend_extension=¡±/usr/lib/php5/20051025/eaccelerator.so¡± eaccelerator.shm_size=¡±0¡å eaccelerator.cache_dir=¡±/var/tmp/eaccelerator5¡å eaccelerator.enable=¡±1¡å eaccelerator.optimizer=¡±1¡å eaccelerator.check_mtime=¡±1¡å eaccelerator.debug=¡±0¡å eaccelerator.filter=¡±" eaccelerator.shm_max=¡±0¡å eaccelerator.shm_ttl=¡±0¡å eaccelerator.shm_prune_period=¡±0¡å eaccelerator.shm_only=¡±0¡å eaccelerator.compress=¡±1¡å eaccelerator.compress_level=¡±9¡å Apache 1 with PHP 4 * apt-get install libapache-mod-php4 php4-mysql php4-gd apache-ssl apache-common libzzip-0-12 php4-common php4-dev apache * dpkg-reconfigure apache and uncheck mod_userdir and check mod_php4 and cancel on hostname * vi /etc/apache/httpd.conf and make sure to add this Listen Your.SECONDIP.Goes.Here:80 NameVirtualHost *# Cache images and javascripts ExpiresActive on ExpiresByType image/gif ¡°access plus 1 week¡± ExpiresByType image/jpeg ¡°access plus 1 week¡± ExpiresByType image/png ¡°access plus 1 week¡± ExpiresByType image/x-icon ¡°access plus 4 week¡± ExpiresByType application/x-javascript ¡°access plus 4 week¡± ExpiresByType application/x-shockwave-flash ¡°access plus 4 week¡±Remove the following <IfModule mod_alias.c> Alias /icons/ /usr/share/apache/icons/ <Directory /usr/share/apache/icons> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> Alias /images/ /usr/share/images/ <Directory /usr/share/images> Options MultiViews AllowOverride None Order allow,deny Allow from all </Directory> </IfModule> <IfModule mod_alias.c> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory /usr/lib/cgi-bin/> AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> </IfModule> Change <Directory /> Options SymLinksIfOwnerMatch AllowOverride All </Directory> ServerSignature Off ServerTokens Prod * cd /usr/local/src * rm -rf eaccelerator-0.9.5 * tar xjvf eaccelerator-0.9.5.tar.bz2 * cd eaccelerator-0.9.5/ * phpize4 * ./configure ¨Cwith-php-config=/usr/bin/php-config4 * make * make install * vi /etc/php4/apache/php.ini and add the following: zend_extension=¡±/usr/lib/php4/20050606/eaccelerator.so¡± eaccelerator.shm_size=¡±0¡å eaccelerator.cache_dir=¡±/var/tmp/eaccelerator4¡å eaccelerator.enable=¡±1¡å eaccelerator.optimizer=¡±1¡å eaccelerator.check_mtime=¡±1¡å eaccelerator.debug=¡±0¡å eaccelerator.filter=¡±" eaccelerator.shm_max=¡±0¡å eaccelerator.shm_ttl=¡±0¡å eaccelerator.shm_prune_period=¡±0¡å eaccelerator.shm_only=¡±0¡å eaccelerator.compress=¡±1¡å eaccelerator.compress_level=¡±9¡å
View Replies!
View Related
Can't Run PHP Stable With Versions Above 5.0.3
Windows 2003 IIS6 PHP 5.0.3 and PHP 5.2.1 running with the ISAPI dll MySQL 5.1.11 I kind of have 2 problems, the first being the one in the thread title and the second is while running any version of php my main site experiences slowdowns and hangs. For some reason whenever I try to install a new version of PHP I have major problems. I have tried several times when new versions come out. I just recently tried the newest, 5.2.1, which I want to try and use, I think there are performance improvements for IIS and windows platform in the new 5.x versions? Anyway I can install 5.2.1 and get it running, and my sites load, but soon after my main site starts to hang, stops loading or loads extremely slow. I can't figure it out. I even tried using the exact same PHP.ini settings from my old working php install. So everytime I am forced to go back to the latest version that I know works with my server/sites, 5.0.3 [url] If I restart IIS the pages start loading fast again right after, even recycling the worker process that the site uses usualy makes the pages load normal again. I tried setting the worker process to recycle every 60min and to use 2 web gardens. These changes havn't really had any affect for better or worse. Downgrading back to PHP 5.0.3 seems to run a bit more stable, but even with this version I get these slowdowns now. I have been running my site(s) on this server for 3 years now and most of the time they have ran stable. -------------------------------------------------------- I was sleeping this morning and recieved a text-message saying the site wasn't loading. So I wake up and the site indeed was pretty much not loading at all. I look at permon that I left running to see this: [url] I give IIS a restart, which you can see above, then the levels go back to normal, here is a screen shot a couple minites later to what the "Current Connections" graph usualy looks like when the site loads fine. [url] During this slowdown the CPU usage was not maxing out, was maybe averaging 60% and ram was 50%. I am getting a 2nd server soon to off-load the MySQL to it and have it dedicated for that. But i don't think that will help this current issue. Here is the system resources when the site is loading fine: [url] I have around 40 or so other sites hosted on IIS and my main site "canadaka.net" which is purple on the top graph, is the only one that hangs or slowsdown. When this slowdown happens to this site, all the other sites on IIS, which are on a seperate worker process, continue to load fine. I can't figure out why these slowdowns are happening.
View Replies!
View Related
IIS - Make PHP Run With .html Extension
I know nothing about IIS as I ormally use Linux / Apache so I'm not sure this is possible. I have built a site in PHP that the client now wants to move over to a IIS-hosted server. Although it's all in PHP because it was a re-build of an old static site I used ModRewrite to make all the page .html. I know IIS doesn't have a URL rewrite feature as such. What I was wondering is, is it possible to configure IIS so that a PHP page can have a .html extension?
View Replies!
View Related
Cheap Reliable Server That Can Run PHP/MySQL With Plesk
I currently have a decent server that runs around 10 websites, but 1 of those sites contributes around 99% of the total traffic. This large site is being moved onto a new server, leaving the remaining 9 sites rattling around on this big (and expensive!) server. So, I am now looking for a smaller server to handle the other smaller sites. They get minimal traffic - around 5k uniques a day.
View Replies!
View Related
Changing Register_globals From .htaccess Will Cause 500 Error When Php Run As CGI
Today I have a customer want to swich the register_globals on on his account ,,, i'm running PHPSuExec and running php as cgi not as Apache module , and as you know using php as cgi will cause internal error 500 if some one add php_flag register_globals on to .htaccess file. what is the soluation to switch register_globals on for his account only without using the .htaccess file. put in mind the php files that need the register_globals to be on is encrypted with zend , so we does not have access to it for modification. have any one have the solution?
View Replies!
View Related
Run Php4 For .php4 Files And Php5 For .php [httpd.conf]
First off my error: apache force downloads .php4 files Background: Im attempting to run php4 and php5 at the same time. I had php 5 installed with the server when I got it. I have installed php 4 from the source like this: Code: ./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/PHP4 --without-mysql I then copied the php.ini file to /PHP4/php.ini In my httpd.conf Im loading and adding both php 4/5 modules like so: Code: LoadModule php4_module libexec/libphp4.so LoadModule php5_module libexec/libphp5.so AddModule mod_php4.c AddModule mod_php5.c Then later in the httpd.conf Im trying to tell apache to handle .php4 files with PHP 4 and .php with PHP5 Code: AddType application/x-httpd-php .php AddType application/x-httpd-php4 .php4 I restarted apache to load the new conf. .php files still use PHP5, but for some reason .php4 files are being downloaded, not running with PHP 4. If I use htaccess to application/x-httpd-php4 php, .php files also force download. What am I missing?
View Replies!
View Related
Crontab
1) #> nano /var/spool/cron/root Then type in the cron entry and save it #> service crond restart It cannot work if have not restart crond 2) #> crontab -e Then type in the cron entry and save it 3) #> nano /etc/crontab type in the cron entry and save it I can use above three method without any problem. However I cannot use crontab [filepath] method 4) #> crontab /home/admin/domain.com/www/testing/crontab.dat *crontab.dat is a cron entry. after type in this line, I use crontab -l and see cron entry has been added to /var/spool/cron/root However, the cron job will not run even I restart crond.
View Replies!
View Related
Crontab
It's been nearly a year i'm running several cron jobs on my CPanel hosting. The format for the command i used is as follows (putting aside the timing info): php /home/account/public_html/subdir/cron/cron1.php A few days ago, all cron jobs stopped working, probably because of a certain setting that my host changed. I contacted my host, and he replied that the format i'm using for the commands was not proper, and he gave me the proper command as: GET [url] I tried it, but it didnt work.... I googled the problem and got tens of commands... i simply wanna run a PHP file (the file itseld is functional if i browse it) every now and then, so what is the command i should be using?
View Replies!
View Related
Where To Find My Crontab
in which folder is the crontab generally located. i run LAMP also,i m looking for a specific cron right now (xbt_cron).once i find it ,what command do i use to run it manually.its supposed to run by itself..i just moved to a new server last week and now its stopped working.
View Replies!
View Related
Crontab Permissions
In trying to setup a cronjob on a new server I notice that cPanel tells me that usr/bin/crontab permissions are wrong and that they need to be changed to 4755. When I log in to the server with WinSCP and attempt to change the permissions it just doesn't do it ... it looks like it's doing it, no errors, but it just leaves it the same!
View Replies!
View Related
Crontab In My Server
I have few servers and when I check my crontab, I found the same line in all servers but at a different time. 43 0 * * * cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php > /dev/null 2>&1 24 20 * * * cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php > /dev/null 2>&1 32 19 * * * cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php > /dev/null 2>&1 3 16 * * * cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php > /dev/null 2>&1 Anyone can explain what are the purpose for these command, and should I make any changes to these to standardize them all (the time) -------------------------------------- Secondly, one of my server doesn't set any automatic CPanel updates, so I set automatic updates for CPanel packages and Security packages. Is it suppose to add "/scripts/upcp" into my crontab? Most of them are also at different time. -------------------------------------- I assume this command is to inform me whenever my user make a new domain add-on? /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify -------------------------------------- Also can anyone tell me what are the purpose of these? /usr/local/bandmin/bandmin /usr/local/bandmin/ipaddrmap /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1 /scripts/exim_tidydb > /dev/null 2>&1 /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
View Replies!
View Related
HTTP Requests With Crontab?
I set up a cron to run every minute & I'm running a PHP script by way of cron like wget http://example.com/some_script.php Now does each request of Cron is a seperate HTTP Request or what? Say my script takes more than 1 minute to execute completely but before its completed, its called again. So, will that effect the PHP script running because of previous HTTP Request or will it create a new HTTP Request & let the previous request finish its operation? Technically, it shouldn't block/affect the previous request, but I'm not sure!!
View Replies!
View Related
Enabling Crontab For Users
I noticed on my new servers users doesnt have crontab permission.On my first server they have access.So what i need to do to enable users crontab permission automaticly on new servers?I have whm/cpanel there but it seems there is nothing about it there.
View Replies!
View Related
Crontab Editing Error
I am trying to edit crontab using crontab -e, I seem to get to it okay but I am unable to edit anything in there, at the end of the file there are ~ in there, and I cant even delete them. Its like the file is locked.
View Replies!
View Related
Wget
I have this big file i want to transfer to my server. The Direct Link to file is being masked by PHP. The URL is "/download.php?file=1" and requires Authentication. Is there any way...i can wget or download the file to server
View Replies!
View Related
Wget
A customer is currently using wget on my server. I read it's not secure to leave this enabled. I was wondering how to disable this and then re-enable it just when this specific customer needs to use it?
View Replies!
View Related
How To: Crontab 4755 CPanel Error Fix
A common error that cPanel show after a fresh install is the: usr/bin/crontab permissions are wrong. Please set to 4755 An easy fix is the using the following commands. Make sure you're using root. chmod 4755 /usr/bin/crontab ps -aux |grep cron /scripts/restartsrv_crond /etc/init.d/crond restart ps -aux |grep cron ls -l /usr/bin/crontab
View Replies!
View Related
Apache Auto-restart Script (crontab)
I have root ssh access to a server and we notice when doing a bash ./mysq-backup script to dump the data from the web site's databases into .sql and .tgz them that httpd goes down sometimes. That, and sometimes it seems that httpd goes down in other situations. All fine, we will figure out why. But .. It would be nice to run a crontab to check every 15 minutes if httpd is running, if not, to restart it. Right now I when I notice the site is down I log into the ssh as root and type: service httpd restart. If it is up it will then first stop it, and restart it. I can look at the screen and see it happen, so I feel pretty safe doing this. One of my concerns is that when I am not at the screen and it stays down .. I do not notice this and downtime increases. And we don't want to just crontab service httpd restart, so a bash script to check for the pid and restart if it down .. would be nice. I thought this would work: (chmod 755 httpdcheck) Code: delta:~ root# cat httpdcheck #!/bin/bash if [ ! "$(pidof httpd)" ] then echo "Could not find pid of httpd - restarting" service httpd restart else echo "Found pid of httpd - NO need to restart" fi delta:~ root# And I have this crontab entry: Code: delta:~ root# crontab -l */5 * * * * /root/httpdcheck | mail my@email delta:~ root# When testing, I did service httpd stop and waited 5 minutes and I received the email : could not find it, restarting. But when I go to the web site in browser it remains down. I have to login to ssh and do service httpd start manually to really load it. Manually loading btw .. shows it works as bash script just fine, so I dont't know why it won't work when run from cron? Code: delta:~ root# ./httpdcheck Could not find pid of httpd - restarting Stopping httpd: [FAILED] Starting httpd: [ OK ] delta:~ root# So .. when is it going wrong? Am I forgetting something?
View Replies!
View Related
WGet Images
I'm trying to do is wget images, however, i'm not sure how to do it 100% right... what ive got is a index.html page that has images(thmubs) that link to the full size images. how do i grab the full size images? Example of links on the page: <a href="images/*random numbers*.jpg" target="_blank"><img border=0 width=112 height=150 src="images/tn_*random numbers*.jpg" style="position:relative;left:3px;top:3px" /></a> i tried wget -A.jpg -r -l1 -np URLHERE
View Replies!
View Related
Wget - Apache
I've just did a 'wget' on a file that's quiet large (2.3GB), and now I'm wanting to serve the file through one of my accounts. The ownership and permissions of the file have already been changed to reflect the specific account; however, when I browse to the file through the web it will not pick up the filesize nor allow me to download the file stating 403 - Forbidden Access. Is there some setting that needs to be changed to allow users to download a file of this size? or am I missing a permission command?
View Replies!
View Related
Cron / WGet
My crontab uses Wget to access a PHP file. It works just fine; however, the only problem is that each time the crontab is run it creates a file in the root of my site called filename.php.10XX filename is the name of the file that Wget runs and 10xx is just the number of times the tab has been run. How can I prevent these files from being created?
View Replies!
View Related
Wget Command
Its been so long since i used it i have forgot, I need to transfer backups to my new server so i can then install them. But i have forgot what wget command to use.
View Replies!
View Related
Not Able To Set Crontab To 4755 In SSH Logged In As Root
For some odd reason, when I run: chmod 4755 /usr/bin/crontab in ssh, it still does not change it to 4755. It's like I don't have permission to change it, ans I'm logged in as root. I've read some threads here on the forum and none really come to an issue where when they run that chmod 4755 /usr/bin/crontab it still doesn't chmod it. So is there a way to check if it is chmodded to 4755 as I use CSF Exploerer to check if it is chmod'd to 4755, and it just stays at 755.
View Replies!
View Related
Wget 403 Forbidden
I am trying to move filename.tar.gz from server A to Server B with root at both, i have moved filename into a web accessable folder and chmod the file 755, when i go to wget filename from server A I get...
View Replies!
View Related
DDoS Attack By Wget
i have been under DDoS attacks, and what it does is it will have different servers wget a certain file so it's all pretty much with HTTP. for example: i had 10000 wget site.com/file.rar from ip x.x.x.x and then same wget from ip y.y.y.y. now question is how could i block this? is it a way on apache2 to limit Downloads per IP (example 1 gb /IP)?
View Replies!
View Related
Wget Downlaoding With Authentication
I been trying to get this file using wget but it uses some sort of advance Authentication that I cant get around using wget it doesnt use cookies it uses some Authentication method. How can I login to that website using wget? the form field names are usernamlc and passlc if I can some how post those two usign wget I can get the download link.
View Replies!
View Related
|