It is very common to forget to apply the code standards before committing. As a result, if you have a GitHub action set up to automatically review them, the action will fail.
Category: PHP
Installing PHP8.0 on macOS
If you take a look at the PHP supported versions, PHP8.0 is not currently supported.
Displaying information in PHPUnit tests
Sometimes, when you are debugging a PHPUnit test, you need to display some variable or another information in the console.
Executing only some PHPUnit tests
When you are creating new tests with PHPUnit, if you execute all tests, it can take some time to execute. To execute them faster, you can filter the tests you want to execute.
Using Composer with a different PHP version than the default one
When you execute Composer, it uses the default PHP version. Sometimes, you will have problems if you use Composer with a different version that the one that executes the project.
Install Composer 2 in a machine with Composer 1
In October 2020, Composer 2 was released. In some servers, I have some projects that need Composer 1 and others that need Composer 2. I will go to explain how to have both versions on the same server.
Incrementar el tamaño máximo de subida de archivo en PHP/WordPress
Si te encuentras con un WordPress u otro software PHP con una limitación de tamaño máximo de subida, resolverlo es muy fácil.
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
Ejecutando
composer update
en una máquina virtual Linux (Laravel Homestead), obtengo este error:
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 72 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 64
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 72 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 64
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
Cómo localizar fechas y horas en PHP
En un proyecto PHP en el que estoy participando tenemos problemas para mostrar las fechas en el idioma que queremos, en este caso en español. En esta entrada te explico cómo localizar fechas y horas en PHP.
PHP Composer killed
Executing the command
composer update
in a Laravel Homestead virtual machine with 2 GB of RAM, I can’t finish it because the command stops with the output
killed