325 questions
0
votes
1
answer
43
views
How do I get Foundation's Block Grid to display across multiple rows?
I'm using PHP8.1 and Foundation 6.8.1.
The code is fetching image names from a database and displaying them in a grid layout: four images in each row, as many rows as is needed. I was doing this all ...
1
vote
2
answers
71
views
Checkboxes Array Retaining UnChecked Checkboxes When Form is Submiited
I'm using PHP8.1 and HTML. I have a form with checkboxes, which are fed dynamically from a MySQL database table. When I uncheck a checkbox and submit the form, the unchecked checkbox is still seen in ...
4
votes
1
answer
133
views
CI4 + PHP 8.1: Finally block not executed when mysqli_sql_exception occurs (but works with register_shutdown_function)
I'm working on a CodeIgniter 4 project (CI: 4.4.3 production mode | PHP: 8.1.32), and I'm running into a strange issue where my finally block never executes if a database error happens during ...
1
vote
1
answer
184
views
Slim Framework 4 with php 8.1 and IIS Server comunication
I have a problem with the operation of the website.
I installed slim framework v.4 I have php v.8.1 and the server IIS
https://www.slimframework.com/docs/v4/
I used this code to try if the project ...
1
vote
1
answer
110
views
How to catch error and continue after a mysql error
I have the following code:
$squery = "SELECT TABLE_SCHEMA,TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%configuration_lang'";
$sres = dbquery($squery);
while ($srow = ...
0
votes
0
answers
70
views
Curl is returning response but Laravel Http client is not returnig respose
-> The below code is based on php Curl.
$curl = curl_init();
// API Endpoint
$url = 'https://api.bybit.com/fht/compliance/tax/v3/private/registertime';
curl_setopt_array($curl, array(
CURLOPT_URL =...
0
votes
1
answer
821
views
BaconQrCode can't run in my laravel 10 and latest vesion of php
I'm working on a Laravel project that uses the baconQrCode library to generate QR codes, and I'm encountering the error Class 'BaconQrCode\Renderer\Image\Png' not found when I call my generateUser ...
0
votes
1
answer
147
views
Debug logs not coming when updating Symfony from v2.8 to v6.4
Debug logs not coming when updating Symfony from v2.8 to v6.4 with PHP8 upgrade.
We have updated our application from Symfony v2.8 to v6.4 along with upgrade of PHP from v7.4 to v8.1. We have used the ...
0
votes
1
answer
142
views
php artisan test on laravel 8 raises ERROR: Command "test" is not defined. Did you mean one of these?
Laravel version: 8
php version: 8.1
When I run php artisan test, I get Command "tests" is not defined.
I added nunomaduro/collision to my dependencies, and I get the error:
NunoMaduro\...
0
votes
0
answers
27
views
Unable to open a connection with phporientdb
I am working on a demigratio sydmfony project towards version 5.4, and I have not been able to connect to my orientdb database. In this project we use ostico/orientdb, here is the error message:
An ...
1
vote
2
answers
378
views
How to properly create form with enum form type, and pass to twig template?
I'm trying to create a edit form for user and want to list current user roles in form and
also want to make choice from all roles from enum Roles.
There is a example of my code.
Current error is "...
1
vote
1
answer
108
views
Trying to access array offset on value of type bool - PHP 8.1 - Wordpress - Mulivendorx plugin
I get this error when this code is run as a Wordpress code snippet using WP Code plugin. I'm sure it has to do with the code provided by the plugin developer being out of date, not in-line with ...
0
votes
1
answer
109
views
Format number to decimal in php
I am sending data by api with json response where it has amount filed.
it is required that amount should be decimal with 2 zeros after the point like this 400.00 and it should not be a string.
I am ...
0
votes
0
answers
90
views
Issue with COM Class Not Found in PHP 8.1 on XAMPP (Windows)
I'm encountering an error while trying to use the COM class in PHP 8.1 on XAMPP (Windows). The error message states: "Fatal error: Uncaught Error: Class 'COM' not found".
I've checked my php....
0
votes
1
answer
401
views
User redirection issue on login page in CodeIgniter 4.5
I am a beginner in programming and I am using CodeIgniter v4.5 to create a user management system. I cannot redirect users who try to access my app dashboard without logging in to the login form.
I ...
0
votes
2
answers
407
views
PHP Readonly properties can't be passed by reference?
<?php
declare(strict_types=1);
class Example {
public readonly array $setOne;
public readonly array $setTwo;
public function __construct()
{
// Populate $setOne and $...
1
vote
0
answers
34
views
PHP 8.1 Mysqli Execute throwing Uncaught ArgumentCountError [duplicate]
Environment:
Ubuntu 20.04
PHP 8.1.28
MySQL 5.7.12
Newrelic 10.19.0.9 (I have found issues with newrelic that seemed promising, but turning off newrelic didn't help). Reference: https://github.com/...
0
votes
0
answers
109
views
PHP error_reporting(E_ERROR); still shows E_DEPRECATED in PHP 8.1
PHP on command line shows E_DEPRECATED even when error_reporting() has been set to only report E_ERROR.
I have this dummy code:
$prev_level = error_reporting(E_ERROR);
echo $prev_level."\n";
...
0
votes
0
answers
126
views
CraftCMS 3: Template not found: dashboard
I am trying to set up and existing CraftCMS 3 installation on a Ubuntu 22.04 machine with PHP8.1. The deprecation errors I can fix, no problem. DB imported, it's accessible, no biggie. All pages load ...
0
votes
2
answers
464
views
why Coverity scan tells the code " $data ?? [] " is logically dead code?
Below are the comments given by Coverity scan. Here there is a chance that $data become undefined, but the code "$data ?? []" will solve that issue. If $data is null output of this code will ...
0
votes
1
answer
313
views
memcached is not working in php 8.1 in windows 10
I want to add php extension for memcached. I downloaded dll (8.1 Thread Safe (TS) x64) from https://pecl.php.net/package/memcached/3.2.0RC2/windows.
Put the php_memcached.dll file in C:\wamp64\bin\php\...
0
votes
1
answer
146
views
PHP: ArgumentCountError on method with optional parameter
PHP 8.1. I declared a method with this signature:
public static function if(mixed $condition, mixed $subject = null, \Closure $callback)
And called it with this call:
CLASS::if(condition: is_numeric(....
1
vote
0
answers
355
views
Got "Error: Maximum execution time of 30 seconds exceeded" everytime I change my code unless I clear the cache in symfony 6 with Docker
Everytime I reload the page, if have made changes in my code, I will get : Error: Maximum execution time of 30 seconds exceeded.
A directory named Container... will appear in the path var/cache/dev . ...
1
vote
0
answers
111
views
IF Error. PHP 8.1.26 Trying to access array offset on value of type bool in
I get the following errors in the theme functions file on a website with Wordpress installed. This error appeared when I upgraded to PHP 8.1.26.
2 Error Log:
[proxy_fcgi:error] AH01071: Got error '...
1
vote
1
answer
210
views
OS X Monterey PHP 8.1 unable to find oci8.so
I downloaded and installed Oracle InstantClient from https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html, and installed it via the Instructions for OS X Monterey....
1
vote
3
answers
672
views
PHP 8.1 Warning: Trying to access array offset on value of type bool in array construction [closed]
I have a problem with the construction of an array which produces this error in PHP 8.1:
Warning: Trying to access array offset on value of type bool in
C:\xampp\htdocs\sito3\xlsx.php on line 250
I ...
0
votes
0
answers
321
views
GD2 won't resize images - deprecated error on Magento 2.4.4-p6 and PHP 8.1
Upgraded to latest version of Magento 2.4.4-p6 and now GD2 will not resize my images
[2023-11-09T00:29:45.553851+00:00] main.CRITICAL: Exception: Deprecated Functionality: Implicit conversion from ...
0
votes
1
answer
62
views
Is There any way to use min of 16 digit after decimal point to perform arithmetic operation in PHP
My actual value is: 0.990641327804487
but while doing php arithmetic operation it convert this number into 0.99064132780449
I have tried number_format function,
if i convert it into number_format it ...
0
votes
1
answer
657
views
GoogleAPI deprecated Return types
I recently updated PHP to version 8.1 on one of my systems. I have also updated Composer version 2.6.5 2023-10-06 10:11:52, using 'composer update' command (see output:)
> composer update
Loading ...
0
votes
2
answers
605
views
Adding Server Block on Nginx for WildCard domains
I have 2 domains as D1 "abc.com" and D2 "def.com". I have configured D1 as following sever block on Nginx.
server {
listen 80;
server_name *.abc.com,abc.com;
root /var/...
0
votes
0
answers
882
views
PHP overload when there are a lot of request
I have a website that receives a lot of traffic load, and when php is not able to handle all requests the web starts to slow down, even at certain times causes an error 502 nginx, I have this setting ...
0
votes
2
answers
109
views
Laravel query wrong format of value
I'm currently develop a web application with Laravel.
My database engine is a Microsoft SQL Server.
For some data I preferred to generate an uuid.
When I use Windows to run my Laravel app, the uuid ...
0
votes
0
answers
60
views
HTTP Error 500 when using ternary operator in PHP
I recently updated the php version on my family tree website from 7.4 to 8.1 and also enabled SSL Certificate to get rid of the "this website is not secure" message. Now my page generates an ...
0
votes
1
answer
77
views
DateTime() and IntlDateFormatter diffrent hours when convert timezone
Example:
$date = new DateTime('2023-09-08 06:00:00.0', new DateTimeZone('UTC')); // USER's timezone
echo $date->format('Y-m-d H:i:s');
$formatter = new IntlDateFormatter(
'en',
...
0
votes
1
answer
637
views
Why doesn't laravel-dompdf load font-face for bold?
I am using laravel-dompdf on my system to output pdfs.
I recently updated php and laravel.
However, some of the pdf's are garbled.
Font is defined by font-face in css.
The font-face is defined in ...
0
votes
1
answer
192
views
Parse escaped comma in a csv file using PHP
I'm trying to parse a csv file. But when trying to parse the following line, I'm facing an issue with an escaped comma.
<?php
$str = "19018216307,Public,\,k]'=system1-system2,20230914143505.5,...
-2
votes
2
answers
739
views
Deprecated error after upgrade PHP Version
I was using below formula in PHP. It was working fine till PHP 7.4. Now I have upgraded to PHP 8.1 and it's giving error.
<?php
echo ((float)13.5 + intdiv((float)13.5, (int)10) * (float)2.5 / (...
-1
votes
1
answer
89
views
Why maker of symfony will abort command line actions that require user input on a docker project on windows?
I am developing a project with Symfony 6.1 on Windows 11 PC. The project is in a docker container.
The problem happens on any execution which requires user input such as: php bin/console make:entity
...
0
votes
0
answers
37
views
Uncaught Error: Class "B" not found. This error giving while using __toString method in php [duplicate]
Giving error while this code applied
Error: Fatal error: Uncaught Error: Class "B" not found in D:\laragon\www\test2\collect.php:6 Stack trace: #0 {main} thrown in D:\laragon\www\test2\...
1
vote
1
answer
469
views
Time zone detection by city/country name php 8.1 / Symfony 5.4
What are the ways to get the time zone given the city code in php8.1 with Symfony 5.4?
5
votes
1
answer
7k
views
PHP files displayed as text. (Error: module php8.1 does not exits) php 8.1 ubuntu 23
When I want to execute a php file it's displayed as text in my browser.
I tried sudo a2enmod php8.1 but it shows an error in return that ERROR: Module php8.1 does not exist!
Show I tried installing ...
0
votes
1
answer
510
views
Laravel session ID changes after every HTTP web request in a feature test
I'm writing a feature test and noticed that the session ID value changes after every request.
For instance, each dumped value will be different:
dump(session()->getId());
$response = $this->get(...
0
votes
1
answer
81
views
How to set a deep value in an object property or array column with link in PHP?
I need a function that can set its deepest value on an instance, whether it is an object or an array.
For example, I have a function like this that I wrote and played with, but the setValue function ...
0
votes
1
answer
1k
views
Fail to decrypt data with openssl_pkcs7_decrypt() on PHP 8.1(openssl 3.0) previously encrypted with PHP 8.0 (openssl 1.1) with openssl_pkcs7_encrypt()
I have been running Alpine Linux image version 3.15 with PHP 8.0 with openssl 1.1.x version on my server.
Using this version I have encrypted some data using openssl_pkcs7_encrypt() function, stored ...
0
votes
0
answers
786
views
cURL is not working in PHP (NGINX, PHP 8.1, Ubuntu)
I have a cURL-based script for sending push notifications to iOS. While it works perfectly on my local machine, I'm encountering issues when running it on an AWS EC2 instance. The instance is running ...
0
votes
1
answer
568
views
Call to undefined function apache_getenv() CentOS Stream 9 and PHP 8.1
I get this error:
Call to undefined function apache_getenv()
I see suggestions to just switch to getenv(), but I don't see why I should have to since the manual implies it should be available for PHP ...
0
votes
0
answers
156
views
my Admin Route is not Working in laravel10
In my case, I have installed Laravel 10 in UBUNTU, after installation,
I created front and admin routes, but there is a problem with routes,
the front route is working, but the admin route is not ...
1
vote
0
answers
78
views
What could cause Laravel to read from another project's ENV file?
I am using XAMPP with 3 projects in the htdocs folder.
suddenly one of the Laravel projects started reading the .env values of another project.
After I restarted XAMPP it was fixed.
Each project is ...
0
votes
1
answer
212
views
Error after organizing the current bundles in pimcore 10.6
Im getting admin interface error after i migrated successfully pimcore 10.6, but admin interface not working.
when i printing echo its printing till render line but getting this error
An exception has ...
2
votes
1
answer
2k
views
Nextcloud Fatal Error Insufficient shared memory
I get this message immediately after reboot trying to run a php script:
# sudo -u apache php updater.phar
Mon Jul 31 17:59:24 2023 (2241): Fatal Error Insufficient shared memory!
It is a Nextcloud ...