Php can it run without a web server?
16art
-
bisous -
bisous -
Can I use PHP to run queries on a database and display the results on a page generated in HTML without using a web server ...
In fact, I only use PHP for that, and I don't host a website ... but I still had to use one since I didn't see any other solution ...
Thank you
In fact, I only use PHP for that, and I don't host a website ... but I still had to use one since I didn't see any other solution ...
Thank you
6 answers
Hello
You can definitely execute PHP scripts by calling php.exe.
I tested it:
- open a Command Prompt window
- navigate to the directory where php.exe is located (cd xxxxx)
- run php by specifying the path to the script to execute.
For example:
C:\Program Files\PHP>php -q c:\wwwroot\index.php3
The result will be output as is in the Command Prompt window. I'm not an expert in Command Prompt, but I think there is a way to redirect this to a text file...
--
Tittom (that's a signature)
You can definitely execute PHP scripts by calling php.exe.
I tested it:
- open a Command Prompt window
- navigate to the directory where php.exe is located (cd xxxxx)
- run php by specifying the path to the script to execute.
For example:
C:\Program Files\PHP>php -q c:\wwwroot\index.php3
The result will be output as is in the Command Prompt window. I'm not an expert in Command Prompt, but I think there is a way to redirect this to a text file...
--
Tittom (that's a signature)
As a supplement:
I created a batch file (test.bat) in which I did:
"c:\program files\php\php.exe" -q %1 >>c:\temp\result.txt
I can now call this batch script by passing the path to a PHP script (for example script.txt, yes yes, .txt), and the result will be stored in the result.txt file in c:\temp
Example:
test script.txt
Of course, you have to be careful with the current directories (cd)
I hope this helps you...
--
Tittom (this is a signature)
I created a batch file (test.bat) in which I did:
"c:\program files\php\php.exe" -q %1 >>c:\temp\result.txt
I can now call this batch script by passing the path to a PHP script (for example script.txt, yes yes, .txt), and the result will be stored in the result.txt file in c:\temp
Example:
test script.txt
Of course, you have to be careful with the current directories (cd)
I hope this helps you...
--
Tittom (this is a signature)