Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
drupal.sh is a handy tool for triggering actions from the command line. Since drupal.sh is often used to trigger heavy operations, it should not use the page cache, which would output the cached page instead of triggering the operation.
This bug affects the drupalorg module, which has an aggregator_cron menu callback which is invoked with php /var/www/drupal.org/htdocs/scripts/drupal.sh --root /var/www/drupal.org/htdocs http://default/aggregator_cron
.
Comment | File | Size | Author |
---|---|---|---|
bootstrap.inc-d6.patch | 759 bytes | drumm | |
bootstrap.inc_.patch | 825 bytes | drumm | |
Comments
Comment #1
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD and DRUPAL-6. Thanks!
Comment #2
lilou CreditAttribution: lilou commentedComment #4
Bevan CreditAttribution: Bevan commentedThis results in the following error; PHP Notice: Undefined index: SERVER_SOFTWARE in [redacted]/includes/bootstrap.inc on line 564 if $_SERVER['SERVER_SOFTWARE'] is not set. I have not tested Drupal 7/head.
Comment #5
drummBevan- are you using a web server or CLI?
Comment #6
Bevan CreditAttribution: Bevan commentedOops – Sorry. CLI on OpenWall Linux (A highly secured distro of linux). Running cron through the web browser works fine – however Cron is run from the command line by calling the php binary.
Comment #7
drummThat makes sense, drupal.sh sets
$_SERVER['SERVER_SOFTWARE']
itself. There is probably a security policy against that sort of thing. Is there any chance a system-level configuration could set$_SERVER['SERVER_SOFTWARE']
?Comment #8
Bevan CreditAttribution: Bevan commentedThis is now beyond my knowledge and skills. I've referred this to other Drupal+OWL users though. Bevan/
Comment #9
drummLooks like that also comes from an environment variable. Try:
Comment #10
Bevan CreditAttribution: Bevan commentedThat works.
Comment #11
Bevan CreditAttribution: Bevan commentedWhat is the solution for this? Shouldn't drupal be checking for
isset($_SERVER['SERVER_SOFTWARE'])
before testing$_SERVER['SERVER_SOFTWARE'] == 'PHP CLI'
, as perE_ALL
-compliance code standards?If
!isset($_SERVER['SERVER_SOFTWARE'])
, should drupal assume CLI?Also it appears that the "Introductory text" on Write E_ALL compliant code is now out of date. I removed it. Please revert if I am incorrect.
Comment #12
drumm