I upgraded a legacy project from: PHP 5.6 -> 8.0 doctrine/orm 2.5.14 -> 2.13.4 doctrine/data-fixtures 1.2.2 -> 1.5.3 Now the following code throws the exception: PDOException : There is no active transaction /var/www/html/src/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:120 /var/www/html/src/vendor/doctrine/dbal/src/Connection.php:1481 /var/www/html/src/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:280 The exception is thrown when DoctrineORMEntityManager::transactional calls: $this->conn->commit() In the documentation I read: Not all RDBMS have the capability to allow TRUNCATE statements inside transactions
Tag: php-8
PHP 8 – merge transparent image over another one
I have two images: $imageBG is the image which needs to be as background $stamp is an image with the same dimensions and has text on it, the background of it is completely transparent. I tried: It results in only $stamp being visible without the background $imageBG then I tried: now only $imageBG is visible I also tried couple other
Fatal error: Uncaught Error: Class “PhalconConfig” not found in Phalcon Php application
I installed Phalcon PHP version 5.0.0beta3 in my Ubuntu, because it’s compatible with PHP 8.0, but when I run my application some Phalcon classes are not found, I already installed the psr module using the following command: and I have installed phalcon.so by direct download from phalcon php github releases, so when I access my phpinfo() I can see it
Laravel 9 html form submit throws 405. Expects PUT, request is GET
I’m trying to create a simple CRUD application with Laravel 9. I’ve run into a problem with HTML forms. I’ve created a page where you can edit data on rabbits existing in my database. My form web.php routes RabbitController.php Before I even hit the controller I get an exception reading: The GET method is not supported for this route. Supported
DRY and Typing Specialization
while I was learning PHP, I thought of a (simple?) problem that I could not solve “properly”. Here it is: I would like to create multiple “specialized containers” I would like to avoid duplicated code For example: So, I could then create “specialized” bag: I understood that it’s not possible in PHP, as it is breaking the Liskov Substitution Principle.
Getting id of PHP 8 Socket
With the new socket instance returning from socket_create() in php 8, how do we get a numeric or unique reference to this socket in the way casting to int would work in earlier versions. This is used for many things, including connection tracking in log files and storing metadata about connections when they are passed into/return from socket_select(). Before php
Problem with ‘apache_getenv’ since upgrading to PHP 8
I’m hoping to get some help with an Apache/PHP 8 issue I’m encountering. Since upgrading to PHP 8 on my LAMP server, my logs have been outputting the following error: I’ve done a quick debug with var_dump(is_callable(‘apache_getenv’)) and the value returns as bool(false). I’ve attempted: Disabling PHP 8, restarting Apache, re-enabling PHP 8, and restarting Apache again Restarting my whole
The correct implementation option is using the magic method __call()
There is a Controller class that contains the magic __call() method, which, when passing an argument, gets a name and creates an instance of the corresponding name. The properties $this of the Controller class are passed to the constructor of this class in order to use the req() function. For example, I recreated the situation from production using examples of
Only annotation mapping is supported by Maker Bundle
I have changed the configuration of my Symfony project to use PHP attributes with Doctrine in my Entities. I was really happy about this and wanted to give it a try. I have changed my doctrine.yaml from annotation to attribute and use attributes in my entities With this configuration my php bin/console do:sc:up -f works well. But when I try
cURL contains an invalid cURL option
I was upgrading from PHP 7.4 to PHP 8 and suddenly this errors appears in my cURL request: I use the following code to build the curl: The targeted file is always an php extensions. ‘buildPostFields’ returns an array of the data. Probably this errors accours because of my php upgrade to version 8, but I cannot find any hints