简体   繁体   English

在后台WAMP中运行SQL Server PHP脚本

[英]Running a SQL Server PHP Script in background WAMP

I've got a script that connects to SQL server to pull some data over to a MySQL database, and I'm wanting to set up scheduled tasks to run this on a regular basis. 我有一个脚本连接到SQL Server,以将一些数据提取到MySQL数据库中,并且我想设置计划的任务以定期运行此任务。 Ideally it should run in the background, but I'm not too fussed if it opens/closes something. 理想情况下,它应该在后台运行,但是如果它打开/关闭某些东西,我不会太着急。

I've made a bat file with the script 我用脚本制作了一个蝙蝠文件

C:\wamp\bin\php\php5.3.0\php.exe "C:\wamp\www\data\import.php"

However it doesn't seem to like the fact it's connecting to SQL Server and it erroring with 但是,它似乎不喜欢它正在连接到SQL Server的事实,并且会出错

PHP Fatal error: Call to undefined function sqlsrv_connect() in c:\wamp\www\includes\connection.php on line 4

Which it doesn't throw when running it in a browser. 在浏览器中运行时不会抛出的错误。 Any ideas? 有任何想法吗?

It looks like your command line PHP (CLI) does not have the SQL Server extension activated. 您的命令行PHP(CLI)似乎没有激活SQL Server扩展。

Try to: 尝试:

  • Check your php.ini file (the CLI-specific one, not the Apache one) 检查您的php.ini文件(特定于CLI的文件,而不是Apache的文件)
  • Run php -m to see what modules are activated in command line. 运行php -m以查看在命令行中激活了哪些模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM