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. 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
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.
Try to:
php.inifile (the CLI-specific one, not the Apache one)php -mto see what modules are activated in command line.