cron php under apache
Hi.
I have run into a problem. I have searched extensively and have been unable to find the answer to my question. I have a file called cron.php I need to run this file daily using crontab. I have tried just about everything that was suggested with no luck. Come to find out I think the root of my problem is php was compiled under apache. I can run cron.php from my browser but I really need to run it late at night and at a specific time. Any expertise would be appreciated. Thank you Dave. |
Why not use lynx:
lynx -source http://whatever/wherever/cron.php |
Is lynx hard to install?
I don't have it on my server. |
Actullay I've had another look at the help section and you may be better with:
lynx -dump http://whatever/wherever/cron.php I've only ever used source but using dump will parse the html so the output will look good in either a browser or in a log file. |
Not hard at all - what disro are you using?
|
Could you re-phrase that question?
I am a newby. Thanks. Dave. |
It is not difficult to install. What linux operating system do you use? RedHat/Mandrake/SuSe
It is a good idea to put it in the "Distribution" section in your profile so that people can direct their help easier :) (It appears to the left of every message) |
Okay. I added it. Is that okay?
|
That is the version of apache (web server) and php.
It is the actual version of linux not the applications that run on it. At the top of the console screen (if you use a GUI then press "Ctrl + Alt + F2") you may see something like: Red Hat Linux release 8.0 (Psyche) Kernel 2.4.18-14 on an i686 The first line tells me that I am using "Red Hat 8.0" You usually see this information when initiating a telnet session too. If you are using a GUI then press "Ctrl + Alt + F7" to get back to it. PS: GUI = Graphical User Interface |
okay. I found it and added it to my profile.
|
That's what I needed!
Download: ftp://rpmfind.net/linux/redhat/updat...4-9.1.i386.rpm Then run this as root: rpm -ivh /path/to/lynx-2.8.4-9.1.i386.rpm Replace /path/to with the directory that you saved the lynx-2.8.4-9.1.i386.rpm file to. eg /home/dave4545 |
I really appreciate it David. I'll try it tonight. Gotta take the kid to see his grandparents. I'll let you know how the install goes.
Thanks. Dave |
hi.
hmm? I tried and got a few errors. I'm searching to see what it is.... Here is exactly how it looks. [root@www3 rpm]# rpm -ivh /usr/local/lynx/lynx-2.8.4-9.1.i386.rpm error: failed dependencies: libcrypto.so.1 is needed by lynx-2.8.4-9.1 libssl.so.1 is needed by lynx-2.8.4-9.1 |
Okay. I guess it means I need to install some more packages.
I looked at some and there are so many different versions. How do you decide which one to use? Thanks. Dave. |
Okay.
I ignored the packages. Gonna see if that works. Nope. Doesn't work without them. |
I use rpmfind.net - enter the package that you want to search for then you can refine your search further.
The searches return: http://rpmfind.net/linux/rpm2html/se...-7.0&arch=i386 http://rpmfind.net/linux/rpm2html/se...-7.0&arch=i386 Both are the same package: ftp://rpmfind.net/linux/redhat/updat....6-16.i386.rpm Follow the install commands as you did for the lynx package. Once the openssl package is installed retry the lynx package install. |
Okay. Here is what I get when I try to install mod_ssl-2.8.12-1.7.i386.rpm
Install failed : error: failed dependencies: webserver is needed by mod_ssl-2.8.12-1.7 libcrypto.so.1 is needed by mod_ssl-2.8.12-1.7 libssl.so.1 is needed by mod_ssl-2.8.12-1.7 So I tried running it again ignoring dependencies and it did its thing. this is what I get when I try to install openssl-0.9.6-16.i386.rpm Install failed : error: failed dependencies: openssl = 0.9.6b-18 is needed by openssl-devel-0.9.6b-18 libcrypto.so.2 is needed by cyrus-sasl-md5-1.5.24-25 libcrypto.so.2 is needed by openldap-2.0.23-4 libcrypto.so.2 is needed by libuser-0.50.2-1 libcrypto.so.2 is needed by sendmail-8.11.6-15 libcrypto.so.2 is needed by cups-libs-1.1.14-15 libcrypto.so.2 is needed by cups-1.1.14-15 libcrypto.so.2 is needed by openssh-3.1p1-3 libcrypto.so.2 is needed by openssh-clients-3.1p1-3 libcrypto.so.2 is needed by python-1.5.2-38 libcrypto.so.2 is needed by curl-7.9.5-2 libcrypto.so.2 is needed by vorbis-tools-1.0rc3-3 libcrypto.so.2 is needed by autofs-3.1.7-28 libcrypto.so.2 is needed by bind-utils-9.2.0-8 libcrypto.so.2 is needed by nss_ldap-185-1 libcrypto.so.2 is needed by openldap-clients-2.0.23-4 libcrypto.so.2 is needed by pidentd-3.0.14-5 libcrypto.so.2 is needed by stunnel-3.22-1 libcrypto.so.2 is needed by ucd-snmp-4.2.4-3 libcrypto.so.2 is needed by wget-1.8.1-4 libcrypto.so.2 is needed by elinks-0.3.0-1 libcrypto.so.2 is needed by fetchmail-5.9.0-5 libcrypto.so.2 is needed by mutt-1.2.5.1-1 libcrypto.so.2 is needed by pine-4.44-7 libcrypto.so.2 is needed by openssh-server-3.1p1-3 libcrypto.so.2 is needed by tcpdump-3.6.2-12 libcrypto.so.2 is needed by ucd-snmp-utils-4.2.4-3 libssl.so.2 is needed by openldap-2.0.23-4 libssl.so.2 is needed by libuser-0.50.2-1 libssl.so.2 is needed by sendmail-8.11.6-15 libssl.so.2 is needed by cups-libs-1.1.14-15 libssl.so.2 is needed by cups-1.1.14-15 libssl.so.2 is needed by python-1.5.2-38 libssl.so.2 is needed by curl-7.9.5-2 libssl.so.2 is needed by vorbis-tools-1.0rc3-3 libssl.so.2 is needed by autofs-3.1.7-28 libssl.so.2 is needed by nss_ldap-185-1 libssl.so.2 is needed by openldap-clients-2.0.23-4 libssl.so.2 is needed by stunnel-3.22-1 libssl.so.2 is needed by wget-1.8.1-4 libssl.so.2 is needed by elinks-0.3.0-1 libssl.so.2 is needed by fetchmail-5.9.0-5 libssl.so.2 is needed by mutt-1.2.5.1-1 libssl.so.2 is needed by pine-4.44-7 I also ran it again Ignoring dependencies and I came up with this. Install failed : package openssl-0.9.6b-18 (which is newer than openssl-0.9.6-16) is already installed I really didn't want to update this because I'm on a live server and I hate to mess up ssl I wonder if there is an easier way to run a php script daily without doing this. |
Oh.
I just typed lynx and this is the message I get. lynx: error while loading shared libraries: libssl.so.1: cannot open shared object file: No such file or directory |
Try creating a symbolic link:
cd /usr/lib ls -l libssl* ln -s /usr/lib/FILE /usr/lib/libssl.so.1 Where FILE is the libssl file installed. |
Hello dave4545 , I don't know if you found a solution to your problem.
You can try the following. put this in a file you make called task_x.sh => wget http://yourserver/yourdir/cron.php then add an entry to crontab with the time you need to run it were you call the .sh file. But from what I've read I think you know how that works. This way you don't need to open a browser to access the cron.php file. |
Oops,
Maybe that isn't clear: don't add the '=>' to the line in task_x.sh |
You shouldn't even need to put it in a script unless you want to check the results. You could just put the command in the crontab.
|
Hey. We tried the symbolic link thing.
When I look at the directory now I see this. Is that right? libssl.so.1 -> /lib/libssl.so.0.9.6b |
That looks OK - does lynx work?
|
It sure does :)
Okay. Now I can try that little trick you have posted in your signature. rm -rf / I guess it is supposed to clean up the trash on my server??? hehe... just kidding. Thanks for the help david. You've taught me a few things. |
No problem - glad it works for you!
|
All times are GMT -5. The time now is 07:30 AM. |