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

2877 views php
1

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.

Browser

enter image description here

Console

enter image description here

answered question

2 Answers

6

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
5

You need to use static paths for your includes like

C:\xampp\htdocs\test.php

posted this

Have an answer?

JD

Please login first before posting an answer.