heridlia
How I can run PHP script without PHP Server like PHP Triad, Xampp, etc.
I think it is simpler and more flexible.
Thanks for sharing.
I think it is simpler and more flexible.
Thanks for sharing.
|
|
Running PHP Script without PHP Server?heridlia
How I can run PHP script without PHP Server like PHP Triad, Xampp, etc.
I think it is simpler and more flexible. Thanks for sharing. JayBee
Just download propper php-5.x.x-Win32.zip from http://php.net/download unpack it to c:\php\
then just run cmd.exe and type
this will execute the script and it will prints script output to console if you want to save this output to file, just type
then open output.html with your favourite web browser if you want tu use this more then once, you should add c:\php\ to your PATH environment variable. Than you can lounch any php script by typing
in any folder kv
Actually, if you use c:\php\php.exe, you will get html output, and this is more optimized towards handling http requests. There is a client version of the interpreter which is bundled with php. This outputs text to console. It will be available at C:\php\cli\php.exe (assuming you installed php under c:\php).
JayBee
No. This was. PHP 5.2.x discard this mass. You have everything in PHP root directory php.exe - console output php-cgi.exe - handling requests (with cgi mode of HTTP server), which also put HTTP header php-win.exe - the same as php.exe, but it don't create any console window (it is good to run scripts at background without text output) as it is written here simplyw00x
There's no such thing as a 'php sever' - php, as the name implies, is a processor. And when you install php by default (i.e. not linked to a webserver) it's php-cli, which is the command-line interface.
No, you won't. You'll get html output if you output <html>. Why not actually check things before you say them? badea
Thank u but can we run python scripts with out python server ???
JayBee
What is python server??? kv
when I said html output, I didn't mean the string "html". I meant http headers, which are not output the client version of interpreter (cli/php.exe). when you run this code,
client version gives output
where as the web version outputs
simplyw00x
I humbly disagree. On my setup, they appear to be processed identically.
You can't run python scripts without python. Whether it's a server is open to debate. ninjakannon
Sorry to barge in like this, but I have a relevant question.
As you can run php in such a way, is there any way to do the same with MySQL, so that you can also simulate, or actually perform, database modifications without setting your computer up as a server? JayBee
You can't access mysql database without server. MySQL and other DBMSs are designed to work as client-server. One server is still running and manage all accesses to the database files. If you want SQL database without server try SQLite http://www.sqlite.org It is small library and it doesn't need any server. ninjakannon
Yeah, I didn't think it was possible. But I only asked because I didn't think that you could run php files without them being on a server where php is installed, and you can. So I had doubts.
I don't quite understand how this works. If I install the program how do I connect to it with php and how does it store databases, etcetera. Thanks once again, JayBee. JayBee
PHP must be installed, but apache (or other http server should not)
PHP has build in support for SQLite 2 or SQlite 3 throw PDO (just download pecl package and enable it in php.ini) It works like you open -> read/write -> close regular file but it is safer and with SQL support. You have one file with database wherever you want. Similar features are with dba_ functions, but with this driver, you don't have SQL to access data. With sqlite_ functions (similar set to mysql_ functions), you work with SQL database, but everything is directly handled with PHP not with another database server. http://php.net/manual/en/ref.sqlite.php http://php.net/manual/en/ref.pdo-sqlite.php http://php.net/manual/en/ref.pdo.php ninjakannon
Oh I see now - thank you very much.
I'm seriously considering installing both php and SQLite so that I can experiment / test with php and a database even without an internet connection (mine cuts automatically every day). What are the limitations of doing this, instead of running scripts on a normal server with MySQL? JayBee
Now it's really off topic
1) You can install your own mysql and work with your local mysql server without internet connection. 2) I don't know any limitations notable here ninjakannon
Ohh, I never thought of that! Just simply installing MySQL itself. I even downloaded the files for it a while ago when I was on another computer to do exactly that, but forgot all about it. Heh, silly me.
Yeah we are. simplyw00x
Limitations of sqlite are that it's slower than mySQl, and afaik less feature-complete. ninjakannon
Okay, thank you, simplyw00x. I did wonder whether it would be less feature complete, but I don't expect this to be a problem. And I don't mind it taking slightly longer either, so that's good. Related topics
|