an htaccess file is read and applied when location entered in browser but not from php in cmd.
Everything is all right when I enter the URL from my browser in localhost WAMP
server.
But when I run the command from cmd it does act like there are not any .htaccess
file.
C:\wamp64\bin\php\php7.2.14 C:\MyProject\dev.project1\test.php
It throws lots of errors particularly this:
include_once(): failed to opening library/Configuration.php for inclusion <include_path='.;C:\php\pear'> in test.php
This doesn't happen from browser though. It includes everything properly. In the .htaccess
file I have:
php_value include_path "C:\MyProject\dev.project1"
Running test.php from browser working perfectly. But not in cmd.
So how can I make PHP from cmd read the .htaccess
a file like a browser version?
Edit: I also have other rules in .htaccess
. Like rewrites
, setenv
for connecting to the database, etc. It is a must for me. In Linux, I am calling php from cronjob
but this problem doesn't occur.