wrong "Unknown Database Server Host" message during web wizard with PHP 5.6 #1057
Labels
bug report
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
I was installing Magento with PHP-FPM 5.6.5 using web wizard and found that on database connection stage it fails with "Unknown Database Server Host.". I was using localhost (also tried 127.0.0.1) so it was a bogus message. With firebug i was able to find a root cause. Query to the http://127.0.0.1/setup/index.php/database-check returns this text:
<br /> <b>Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br /> <br /> <b>Warning</b>: Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br /> {"success":true}
This is not magento issue, but PHP 5.6 limitation discussed at https://bugs.php.net/bug.php?id=66763.
After i changed always_populate_raw_post_data to -1 installation was successful. I would recommend to add check if PHP is 5.6 and 'always_populate_raw_post_data' is not set to '-1'. Also it would be great to improve parsing of the database-check script response to paste warning to user if such broken response is returned. Also it would affect not only magento installer but probably magento itself if not set correctly.
P.S. here is a long discussion about this problem https://www.bram.us/2014/10/26/php-5-6-automatically-populating-http_raw_post_data-is-deprecated-and-will-be-removed-in-a-future-version/
The text was updated successfully, but these errors were encountered: