How to add imagick to Docker alpine:latest without pecl

Updated: 19th July 2024
Tags: php docker

PHP helper function for path

Updated: 17th July 2024
Tags: php

[Solved] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry for key 'failed_jobs_uuid_unique'

Updated: 13th June 2024
Tags: php laravel

[Solved] CSRF Token Mismatch Error from API Laravel Sanctum

Updated: 14th April 2024
Tags: php laravel sanctum

[Solved] Composer require / Generating optimized autoload files is very slow

Updated: 14th April 2024
Tags: php composer laravel windows10

Add whole directory of your app to windows defender Exclusions. You can also move your projects in project directory and add projects to exclusion.

PHP and money calculations

Updated: 10th January 2024
Tags: php

Please, use integer as cents, don’t do my mistake, if you are using PHP.

I was shocked when discovered that php is using float and doesn’t have decimal. I have a lot of code already done, so I used bcmath to get around, but if I had known this earlier, I would have used integers.

php get link from atom feed

Updated: 26th May 2023
Tags: php

How to read rss or atom with php

Updated: 26th May 2023
Tags: php

How to post to facebook page using api with plain php

Updated: 26th April 2023
Tags: php facebook

crop center and resize image using cwebp respecting aspect ratio (php)

Updated: 30th March 2023
Tags: php cwebp

Convert php array to javascript array

Updated: 28th March 2023
Tags: php javascript

[Solved] file_put_contents(/bootstrap/cache/packages.php): failed to open stream: Permission denied

Updated: 17th February 2023
Tags: laravel php ubuntu

php echo (convert) date to RFC 3339

Updated: 3th February 2023
Tags: php
echo date(DATE_RFC3339);
//convert from other format
echo date(DATE_RFC3339, strtotime('2023-01-01 05:55:55'));

[Solved] PHP Fatal error: Allowed memory size bytes exhausted (tried to allocate 67108872 bytes) in Composer/DependencyResolver/RuleSet.php on line 83

Updated: 14th October 2022
Tags: php composer

Remove index.php from url nginx laravel

Updated: 8th June 2022
Tags: nginx php

My programming tips after 10 years of programming

Updated: 28th April 2022
Tags: php mysql

Redis vs Memcache for PHP

Updated: 24th March 2022
Tags: redis memcached php

Memcache. It allows you to store both strings and php arrays and have fun. If it is not enough, try redis.

PHP how to make work curl with CURLOPT_SSL_VERIFYHOST or fix php curl SSL certificate

Updated: 23th March 2022
Tags: php curl

Don't rely on isset to check if it is isset!

Updated: 15th June 2021
Tags: php

Php isset will tell false if variable is null.

//false
isset($a[1]);

$a[1] = null;
//false
isset($a[1]);

That’s why you should use array_key_exists if you need to check if it is set or not.

//false
array_key_exists($a[1]);

$a[1] = null;
//true
array_key_exists($a[1]);

Laravel clear queue job code cache

Updated: 12th April 2021
Tags: php laravel

Laravel queue job is caching your job php code, so after updating job code you need to:

php artisan queue:restart