image
image

|


Go Back   macosx.com > Design, Media, Programming & Scripting > Design & Media

Reply
 
Thread Tools
  #1  
Old April 8th, 2002, 09:58 PM
Registered User
 
Join Date: Aug 2001
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Zimbop is on a distinguished road
Post PHP and Crontab

I'm using PHP compiled by Marc Liyanage at http://www.entropy.ch/ (I think it's an Apache module). It works great in every respect, however, I would like to run .php files with cron and have tried using cronnix to do this but have had no luck.

I was using the shebang line #!/usr/bin/php which has worked on virtual web hosting accounts on linux in the past.

Now, there's no "php" in /usr/bin/php only "php-config" "phpextdist" "phpize" and "phptar".

So how do I execute "test.php". Is it possible with the apache module version of PHP or does it need to be the CGI version. And where is php, if in the terminal I go "whereis sendmail" I get "/usr/sbin/sendmail", but if I do "whereis php" I get nothing!

Regards

Zimbop
Reply With Quote
  #2  
Old April 9th, 2002, 11:09 AM
Registered User
 
Join Date: Jun 2001
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
strikeman is on a distinguished road
Thumbs up

I compiled a standalone php executable into /usr/bin/, and my crontab uses that to run my php scripts.
Reply With Quote
  #3  
Old December 2nd, 2002, 08:20 AM
Registered User
 
Join Date: Jun 2002
Location: The lowlands of freedom
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
elspif is on a distinguished road
how do I compile a stand alone php executable?
Reply With Quote
  #4  
Old December 2nd, 2002, 09:38 AM
Fahrvergnuugen's Avatar
I am the law!
 
Join Date: Apr 2001
Location: Galway, NY
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
Fahrvergnuugen is on a distinguished road
you will either have to find the binary somewhere or compile it yourself...which can be a bit tricky. I havn't tried compiling php since 4.1 and then it was such a pita.
__________________
-Paul Wieland______________
http://www.sickdimension.com
Dual G5 2.0Ghz / 2.5GB Ram / 620 GB HD / 23" CD
Reply With Quote
  #5  
Old December 3rd, 2002, 10:17 AM
Registered User
 
Join Date: Jun 2002
Location: The lowlands of freedom
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
elspif is on a distinguished road
I found a binary but don't know how to run it. The file is a .gz file but won't unzip or anything. If I just run it like it is it won't go. Any hints?

Found it at www.etropy.ch where the other tutorials are under the FAQ:

>Can I also get the CGI version of PHP?"
>Yes. Here is the binary (at version 4.1.1).

With a link to http://www2.entropy.ch/download/php-cgi-4.1.1.gz

I must be doing something dumb but please let me know what

thx
Reply With Quote
  #6  
Old December 3rd, 2002, 11:58 AM
Registered User
 
Join Date: Aug 2001
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Zimbop is on a distinguished road
put it in your home directory and then open a terminal and type:

gunzip php-cgi-4.1.1.gz

That should unzip it.
Reply With Quote
  #7  
Old December 4th, 2002, 06:26 AM
Registered User
 
Join Date: Jun 2002
Location: The lowlands of freedom
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
elspif is on a distinguished road
I did that but it tells me the file is not in gzip format. Are there other formats? Can i untar this or what? I tried most things even going into classic and using the old stuffit expander. Any tips are welcome. This is what Darwin tells me:

Welcome to Darwin!
[local:~] spif% ls
Desktop Icon? Public jbproject
Documents Library SME php-cgi-4.1.1.gz
Downloads Movies Sites
Eleven Music Temp
Fonts Pictures To Print
[local:~] spif% gunzip php-cgi-4.1.1.gz

gunzip: php-cgi-4.1.1.gz: not in gzip format
[local:~] spif%
Reply With Quote
  #8  
Old December 4th, 2002, 08:16 PM
Registered User
 
Join Date: Jan 2002
Location: Las Vegas, NV
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
namaste is on a distinguished road
One way to use cron with the module would be to put something like curl http://someurl.com/myscript.php in your shell script. I've used this often to trigger php scripts on machines that are using php as a module on both apache and IIS.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail on localhost w/ php .jeremy_a> Unix & X11 1 November 8th, 2003 09:27 AM


All times are GMT -5. The time now is 08:00 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.