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

Use of undefined constant STDIN, fgets() issues running Drush. #4356

Closed
liquidcms opened this issue Mar 20, 2020 · 5 comments
Closed

Use of undefined constant STDIN, fgets() issues running Drush. #4356

liquidcms opened this issue Mar 20, 2020 · 5 comments

Comments

@liquidcms
Copy link

I am posting just to see if anyone has seen these issues before:

Yesterday drush was running fine on our server. I suspect our hosting company modified something; most likely to do with PHP CLI. These are a few issues which i see now; which weren't there yesterday.

  1. following commands all work: cron, cr, st but the output of all of them has this at the end:
    X-Powered-By: PHP/7.2.28
    Content-type: text/html; charset=UTF-8

  2. drush updb fails:
    [warning] Use of undefined constant STDIN - assumed 'STDIN' (this will throw an Error in a future version of PHP) QuestionHelper.php:158
    [warning] fgets() expects parameter 1 to be resource, string given QuestionHelper.php:174

  3. drush was (removed for bugfixes #1, Error using --no-core & --prepare-install #2 above) complaining about my local php.ini having:
    disable_functions = shell_exec,system

  4. every drush command was failing due to a http to https chunk of code that i had in my settings.php (removed for bugfixes #1, Error using --no-core & --prepare-install #2 above).

These all worked yesterday.

System Configuration

Q A
Drush version? 10.2.2
Drupal version? 8.8.4
PHP version 7.2.28
OS? CentOS 7
@liquidcms
Copy link
Author

Even more oddness.. when i called in to our hosting support; the guy there tried it and it worked fine. So it has something to do with ip, ssh client, session, etc. Although, I tried from a different IP with a different SSH client.. still broken.

@greg-1-anderson
Copy link
Member

Somehow you are using php-cgi instead of php-cli. Check your $PATH, which drush etc.

@liquidcms
Copy link
Author

Hi Greg... and yes.. i just figured that partially out.. like 2 min ago.. on call with hosting company now to sort it out.. but thanks a ton.

@liquidcms
Copy link
Author

liquidcms commented Mar 20, 2020

Yes, path was wrong.. /usr/bin was ahead of /usr/local/bin which was putting php-fcgi ahead of php-cli

fixing that and it now runs without tacking:
X-Powered-By: PHP/7.2.28
Content-type: text/html; charset=UTF-8
at the end of every command.

And drush updb now runs correctly...

unfortunately cr, which did work when PATH was wrong.. now spits out:
[warning] Drush command terminated abnormally.

even though --vvv is no help; my guess is cli php.ini is now to blame and there is a memory issue.. but just a guess..

@liquidcms
Copy link
Author

yes, tracking down cli php.ini and setting memory_limit = -1 fixed issue with cr.. and now all is well.

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

No branches or pull requests

2 participants