PHP with MSSQL Connection not working in command Line (cmd)

2877 views php

I want to run my php Script from the command line but it always throws an error. If i run the same Script in a Browser everything works fine. There seems to be a problem with the paths. But the .dll files are in the correct folder. I also tried "Run as Administrator" but the error still exists.


enter image description here


enter image description here

answered question

2 Answers


The reason is that PHP CLI uses different phpini config. you need to set a custom config and load it with new settings: use this article to create a custom .ini and use it with CLI

posted this

You need to use static paths for your includes like


posted this

Have an answer?


Please login first before posting an answer.