Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 692
  • Last Modified:

undefined function: mssql_connect()

I use an apache server on linux machine and try to run a simple php script including mssql_connect() to retrive data in windows machine. However, the problem is it works fine running browsers but not command line.  When I run it on the command line, it complains like this following:

PHP Fatal error:  Call to undefined function:  mssql_connect() in /var/www/html/cron_job/Joon_db_connect_test.php on line 10
Content-type: text/html
X-Powered-By: PHP/4.3.4

<br />
<b>Fatal error</b>:  Call to undefined function:  mssql_connect() in <b>/var/www/html/cron_job/Joon_db_connect_test.php</b> on line <b>10</b><br />

I am eager to hear back from you to solve this problem.
2 Solutions
Guy Hengel [angelIII / a3]Billing EngineerCommented:
did you properly configure the php.ini to allow the mssql extensions, resp is the binary for mssql installed on the box?
Per http://us2.php.net/mssql , you must have the MS SQL Client Tools installed on the system where PHP is installed.

As suggested above the MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now