| | |
How to execute php script without browser?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: May 2008
Posts: 257
Reputation:
Solved Threads: 20
0
#2 Oct 22nd, 2009
Several ways to run a PHP script outside browser:
CLI (Command Line Interface)
Call your script like
Telnet/SSH (Same as above)
Crond
On *NIX systems there is something called CROND which allows you to execute scripts according to a schedule E.G. every hour, every day, the first monday of each month etc.
Look up CROND tutorials on Google and use the above CLI example as your script
#!
Not sure if this works but you may be able to run it by adding the line
If I have not answered your question just say but those are the main ways of running scripts outside browser
CLI (Command Line Interface)
Call your script like
#php /path/to/your/script.php from terminal/CMDTelnet/SSH (Same as above)
Crond
On *NIX systems there is something called CROND which allows you to execute scripts according to a schedule E.G. every hour, every day, the first monday of each month etc.
Look up CROND tutorials on Google and use the above CLI example as your script
#!
Not sure if this works but you may be able to run it by adding the line
#! /etc/php to the first line of your script then run it by double clicking (Only on Unix/Linux)If I have not answered your question just say but those are the main ways of running scripts outside browser
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#3 Oct 22nd, 2009
thanks.good post.I am aware about setting up the cron but here we should not do that.
I did a script to run as a process and transferred it to some server using ftp, so we don't have remote access to that server.
So no double clicking the file, that way, though it seem to be a good option (thanks for it, i will like it to give a try sometime later,i just got to see it).
Hope i cleared the scenario , if not please ask, i will need to clarify.
I did a script to run as a process and transferred it to some server using ftp, so we don't have remote access to that server.
So no double clicking the file, that way, though it seem to be a good option (thanks for it, i will like it to give a try sometime later,i just got to see it).
Hope i cleared the scenario , if not please ask, i will need to clarify.
•
•
Join Date: May 2008
Posts: 257
Reputation:
Solved Threads: 20
0
#4 Oct 22nd, 2009
If you only have basic FTP access I don't think its possible, some admin panels will let you do it (if you have one) but other than that no ideas so sorry =(
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 1
0
#6 Oct 22nd, 2009
There is another way if you have ssh access to the server and a local Linux machine. From the local Linux machine use rsh to invoke the script on the server. There are several tricks that can be employed here that would allow you to automate access to your server without requiring username and password, a search for Private/Public Key and known_hosts should do the trick. Just remember to set permissions on the script so that it is executable and as mentioned above ensure that the first line of the script identifies the PHP CLI runtime.
![]() |
Similar Threads
- PHP Script not running (PHP)
- Is it possbile to launch a 'Browse for Folder' dialog box from PHP script (PHP)
- simple php script fix (PHP)
- Execute PHP file in the background from html page (PHP)
- Compile PHP (PHP)
- cPanel: email account creation. I need help making a PHP script. (PHP)
- question about connecting odbc to sql through php script (PHP)
- how to make member expire after so many days with php script (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP code for uploading Excel sheet
- Next Thread: Voting issue
| Thread Tools | Search this Thread |
Tag cloud for execute, execution, php, remote, script, server
.net adobe ajax apache api array asp backup basic beginner business c# class client cms code curl daniweb data database date desktop display dreamweaver email error external file files flash form forms function functions google hosting html httppost ibm image include integration java javascript jquery lamp limit link linux login longisland mail memory menu microsoft multiple mysql network news oop open paypal php post programming protocol python query radio redhat remote remoting script search security server session sms soap socket software source spam sql ssh table tutorial upload validation vbulletin video virus web webdesign websitecontactform websphere windows xml youtube zend






