Category Archives: php

PHP iconv Detected an illegal character in input string

With the following code: echo iconv(‘utf-8’, ‘Windows-1250//ignore’, $xml); I got the following PHP error: iconv(): Detected an illegal character in input string Solution Uppercase IGNORE ūüėÄ echo iconv(‘utf-8’, ‘Windows-1250//IGNORE’, $xml);

Posted in php | Tagged , | Leave a comment

Prestashop on localhost with friendly URL

Finally got Prestashop to run on localhost for development Changes in the database: — — Localhost modifications for dev — UPDATE `shop_url` SET `domain` = ‘localhost’, `domain_ssl` = ‘localhost’, `physical_uri` = ‘/example.eu/’ WHERE `id_shop_url` = ‘1’; UPDATE `employee` SET `lastname` … Continue reading

Posted in php | Tagged , | Leave a comment

Historical Euro Rates via PHP

Just a promo post for a newly published Github repo https://github.com/mikaelz/HistoricalEuroRates

Posted in php | Tagged | Leave a comment

Phinx migrate in PHP without CLI

I wanted to run Phinx‘s migrate from PHP without CLI and thanks to¬†https://github.com/robmorgan/phinx/issues/137#issuecomment-26220408 I got it working: The result:

Posted in php | Tagged , | Leave a comment

Composer memory limit errors

According to docs¬†https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors I ended up aliasing composer command: alias composer=”php -d memory_limit=-1 $(which composer)”

Posted in cli, php | Tagged | Leave a comment

Fixing MailChimp error “Data did not match any of the schemas described in anyOf.”

While PUTing subscribers into MailChimp I got a bunch of “Data did not match any of the schemas described in anyOf.” error responses from the API server. Tried googling, but with no luck. Second try was to look at the … Continue reading

Posted in php, Uncategorized | Tagged , | Leave a comment

Fixing “Automatically populating $HTTP_RAW_POST_DATA is deprecated”

To reproduce try: curl -X POST -H “Content-Type: application/json” -d “{foo: bar}” http://example.com Great explanation can be found at¬†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/ For me the solution on the shared hosting was adding the following line in¬†.htaccess: php_value always_populate_raw_post_data -1 Thanks to https://www.drupal.org/node/2485847#comment-10068266

Posted in php, Uncategorized | Tagged , | Leave a comment