2,727 questions
0
votes
1
answer
101
views
Can I check if ReflectionType is instance of another type?
I want to check if a callable's return type is an instance of another type. For example, let's say I a have:
A class Pigeon which extends Animal.
A function addSupplier() which takes a callable ...
1
vote
0
answers
61
views
Can I persist a flag across all sessions?
I have an expensive operation that runs in my PHP application when the /api/replicate endpoint is requested. The operation takes roughly 30 seconds, so I want to prevent this endpoint from being ...
0
votes
1
answer
80
views
Errors PHP Notice: Undefined offset:, Trying to access array offset on value of type null
I get multiples php errors in server log , the error show on 2 lines of my php code, However php script is working but it show these errors in server log.
PHP Notice: Trying to access array offset on ...
-1
votes
2
answers
70
views
$_GET not display character like & [duplicate]
i tried to create a script to redirect link of amazon, but when pass the link in a get variable url not return Url after the character &, i tried to echo the variable $_GET['tolink'] but display a ...
0
votes
0
answers
139
views
Encryption/Decryption with Sodium extension with php 5.6 not working
My Old project is on 5.6 so Sodium extension for Encryption/Decryption is not working so my system engineer set some setting that if I run file with .php7 extension it run on php 7 and normal .php ...
0
votes
1
answer
36
views
Under the Laravel 7 (php7) system, if I query any id of my table, there is no result
Under the Laravel 7 (php7) system, if I query any id of my table, there is no result, but if I enter the id value as a string, then there is a result.
In the table, the id column type is int(11). ...
0
votes
2
answers
514
views
Prestashop 1.7: Use statement not working in module main php file
I would like to edit the kpi section on the admin orders page,in Prestashop 1.7, so i created a module, i tried to use a custom module class, in the module's main php file, but i got error
so I ...
2
votes
0
answers
348
views
Errors in PHP 7 - why set_error_handler() can't catch this type of error?
Fatal error: Uncaught TypeError...
Why is this an exception according to PHP if TypeError inherits from Error? Why can't set_error_handler() catch this type of error?
https://www.php.net/manual/en/...
0
votes
0
answers
163
views
Call one controller function from another using Curl PHP in CodeIgniter 3
Hi I am using Curl PHP to callone controller from Another but even after passing CSRF it is giving me 403 error
MAIN controller file
`
<?php
defined('BASEPATH') or exit('No direct script access ...
0
votes
1
answer
352
views
phpinfo() changes the status code of nginx response in a weird way
I have a php code that should always end up being "http 500 code" as I have a call to undefined func status_code("OK");
code:
<?
# phpinfo();
echo 'error_log = ' . ini_get('...
0
votes
0
answers
90
views
Bypass auto wiring using services.yml symfony
I have a quick question regarding auto wiring on symfony.
I am currently migrating my symfony 2.8 app to symfony 5.4. I have my BaseManager class which is used by several manager of my application.
...
0
votes
1
answer
465
views
How to properly flush buffer without error suppression
I found this snippet many years ago, it's always done me well but I found out recently that error_get_last() and any custom error handlers will ignore the @ and still trigger.
The recommended approach ...
0
votes
1
answer
165
views
Update key value in array of objects php
I have an array of objects where the reference is not the same as the code_cip.
Array (
[9921279] => lignecatalogue Object ( [id] => 3013181 [reference] => 9921279 [commentaire] => [...
-1
votes
1
answer
145
views
PHP exec shell script return status 2
I want to execute shell script from my php application deployed on Red Hat linux server, I added this line to my application
exec("/app/sh/script.sh user server.info.com cmd.com 0 1 1" ,
...
1
vote
1
answer
607
views
Composer issues when running mPDF in PHP 7.4
I get the following error when running mPDF in my browser. I have just installed the latest version of mPDF on my cloud server running PHP 7.4. The requirements page for mPDF say I should be able to ...
1
vote
1
answer
74
views
How to do covert to this code block to php v7.4 or fix the syntax error
Currently I'm working with a laravel base ecommerce project and I got a domain mapping plugin which they provide. But the problem is it's only working on php8 or 8+, but my application runs on php v7....
0
votes
0
answers
53
views
php7 compatibility: Uncaught Exception: Error
can you help me update this script for compatibility with php7? I get error: Uncaught Exception: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ...
1
vote
0
answers
135
views
PHP, Docker, Apache & EC2 - intermittent POST request failures
I'm getting some very odd behaviour with my app on AWS EC2. Every now and again, when a form is submitted via POST, it'll bomb out straight away displaying the submitted form data. There are no logs ...
0
votes
1
answer
2k
views
Run jobs one after another in Laravel 8
I'm trying to automate a process composed from multiple jobs. Every job had a goal, so I'm running a global job who is responsible for creating child jobs.
- Job-1
Global Job -> - ...
0
votes
1
answer
732
views
Laravel - Passing data from multiple methods from the same controller to a partial view
I have a simple phone book application with a main view, index.blade.php that includes a partial view, contact_list.blade.php.
I only have a single route that refers to my controller, ...
0
votes
2
answers
3k
views
Laravel - PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vestibulare.app\models\telefone' doesn't exist
I'm new to Laravel.
I'm trying to access some data from within a partial view.
I tried to put my query inside the boot method of AppServiceProvider, but Im getting this error:
PDOException::("...
1
vote
1
answer
220
views
Upgrading from PHP 5 to PHP 7.4
I'm upgrading an exsiting application from PHP 5.3 to PHP 7.4
class Cl_Detail_Familles_Produit extends Cl_Form
{
public $ref_annuler = "../coh/list_produit.inc";
.
.
...
-2
votes
1
answer
151
views
FInd Missing number and MIN and MAX Value and find Dublicate values count WITHOUT using PHP inbuild functions.Checked many but no suitable for me [closed]
I am having below array
$inputArray = array(1, 2, 5, 7,2);
Now i want to find MIN and MAX Values.
Second Thing find missing values in this array
Third dublicate number count, How can i acheive ...
0
votes
1
answer
559
views
How to manage includes, require and use in this project
In this PHP project without framework, I have this folder structure: Adapter, Class and Models
A php file "index.php" is executed from the root and I have problems handling the model and ...
0
votes
1
answer
449
views
how to show databases name in codeigniter 3
hy everyone, can I get list of databases name in mysql server on codeigniter3
I have tried this codeigniter3 query code but still not worked:
$databases = $this->db->query('show databases');
I ...