Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: Use of undefined constant STDERR #173

Closed
drupalroller opened this issue Oct 3, 2016 · 4 comments
Closed

Notice: Use of undefined constant STDERR #173

drupalroller opened this issue Oct 3, 2016 · 4 comments
Assignees
Labels

Comments

@drupalroller
Copy link

I'm getting this error notice every time i use the library.

Notice: Use of undefined constant STDERR - assumed 'STDERR' in Google\AdsApi\AdWords\AdWordsSessionBuilder->defaultOptionals() (line 239 of ******/docroot/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsSessionBuilder.php).

@vtsao vtsao self-assigned this Oct 3, 2016
@vtsao
Copy link
Contributor

vtsao commented Oct 3, 2016

@drupalroller thanks for reporting this. I'm assuming you're using this library in a web application right? I believe PHP only recognizes STDERR for CLI applications. We'll look into changing how the default logger is setup for this library.

In the meantime you can setup your own logger when building an AW session to avoid this.

@hakimio
Copy link

hakimio commented Nov 2, 2016

Maybe path to log file could be specified in the config file and it could use that instead of just standard console output?

@vtsao
Copy link
Contributor

vtsao commented Nov 3, 2016

@drupalroller using fopen('php://stderr', 'w') instead of the STDERR constants (which is only defined when running PHP in the CLI) should fix this, will make an update.

@hakimio that's a good idea, will add that convenience feature, as you can always specify your own Monolog logger that writes to a file as well.

@vtsao
Copy link
Contributor

vtsao commented Dec 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants