Home > php教程 > php手册 > body text

使用PHP命令行执行PHP脚本的注意事项

WBOY
Release: 2016-06-06 20:09:34
Original
1495 people have browsed it

如果你使用的wamp集成安装环境的话,那么你php的配置是在D:\wamp\bin\apache\Apache2.2.17\bin 你要先把他复制覆盖掉D:\wamp\bin\php\php5.3.3下的php.ini,否则当你调用扩展函数的时候会报错误如:Fatal error: Call to undefined function 如果你懒得写那么

如果你使用的wamp集成安装环境的话,那么你php的配置是在D:\wamp\bin\apache\Apache2.2.17\bin

你要先把他复制覆盖掉D:\wamp\bin\php\php5.3.3下的php.ini,否则当你调用扩展函数的时候会报错误如:Fatal error: Call to undefined function

如果你懒得写那么大长串php的路径,你也可以把D:\wamp\bin\php\php5.3.3加到环境变量path里面。

另外关于传参的问题。 比如我要执行test.php?a=123

命令行中我们就可以写 php test.php 123

在test.php中使用$argv[1]来接收123.

附上一个bat的可执行文件作为参考

@echo off
php D:\wamp\www\taobao\items.php 158345687
php D:\wamp\www\taobao\refunds_up.php 158345687
php D:\wamp\www\taobao\trade.php 158345687
echo.&echo 请按任意键关闭BAT窗口...&pause
exit
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!