command line: undefined function: mssql_connect()
Posted: Fri May 15, 2009 12:37 am
I have a PHP program that calls mssql_connect(). When I execute this program in a web browser, it succeeds. When I execute this program from the command line (with the -q flag), I get:
Fatal error: Call to undefined function: mssql_connect() in C:\test.php on line 16
Even if I call dl("php_mssql.dll") in the command line program I get the same error.
Any suggestions? Thanks.
My configurations:
PHP 4.4.2
Apache HTTP Server 2.0.58
Windows Server 2000
In php.ini I have uncommented:
extension=php_mssql.dll
When I call get_loaded_extensions() in a browser:
Array (
[0] => standard
[1] => bcmath
[2] => calendar
[3] => ctype
[4] => com
[5] => ftp
[6] => mysql
[7] => odbc
[8] => overload
[9] => pcre
[10] => session
[11] => tokenizer
[12] => xml
[13] => wddx
[14] => zlib
[15] => apache2handler
[16] => mssql
)
When I call get_loaded_extensions() from the command line:
Array (
[0] => standard
[1] => bcmath
[2] => calendar
[3] => ctype
[4] => com
[5] => ftp
[6] => mysql
[7] => odbc
[8] => overload
[9] => pcre
[10] => session
[11] => tokenizer
[12] => xml
[13] => wddx
[14] => zlib
)
Notice the missing [16] => mssql.
Fatal error: Call to undefined function: mssql_connect() in C:\test.php on line 16
Even if I call dl("php_mssql.dll") in the command line program I get the same error.
Any suggestions? Thanks.
My configurations:
PHP 4.4.2
Apache HTTP Server 2.0.58
Windows Server 2000
In php.ini I have uncommented:
extension=php_mssql.dll
When I call get_loaded_extensions() in a browser:
Array (
[0] => standard
[1] => bcmath
[2] => calendar
[3] => ctype
[4] => com
[5] => ftp
[6] => mysql
[7] => odbc
[8] => overload
[9] => pcre
[10] => session
[11] => tokenizer
[12] => xml
[13] => wddx
[14] => zlib
[15] => apache2handler
[16] => mssql
)
When I call get_loaded_extensions() from the command line:
Array (
[0] => standard
[1] => bcmath
[2] => calendar
[3] => ctype
[4] => com
[5] => ftp
[6] => mysql
[7] => odbc
[8] => overload
[9] => pcre
[10] => session
[11] => tokenizer
[12] => xml
[13] => wddx
[14] => zlib
)
Notice the missing [16] => mssql.