0

I am facing a puzzle, im testing some scripts on my wamp installation. When i do a echo date('d) and i run the script from the browser i see the correct week day, by example, lets say it echo 'Mon', but.. when i execute it from a batch file, the echo shows the next day, by example 'Tue', why this can be happening? I have the correct timezone in my php.ini the windows clock as well, i dont have a clue why this is happening. In the same puzzle, i have a path to a dbconnect file, again, from browser it run ok, but from the batch file it dont find the included path, i solved it writing the full windows path C:/path/to/file.php but i dont understand why, the include is done by the php file executed by the batch file, so the path should be ok right?

If someone can share some lights i would appreciate it.

2 Answers 2

2

In WAMP the CLI uses a separate php.ini file in the PHP installation directory (e.g. C:\wamp\bin\php\php5.3.13) rather than the one under the Apache installation so check the settings in that file for running PHP on the command line.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks bro! You are right, the one under bin/ had a different timezone.
and any idea about the path?
1

Using php through the browser is using the CGI/FPM version and with your command line it is the CLI version. CLI and server (cgi/fpm) use different php.ini-files. On cli type

php --ini

To find where your ini file is and correct it.

1 Comment

Thanks yes, i checked the php.ini under the bin/ folder as @robjingram mention and had a different timezone. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.