All Questions
Tagged with error-handling php
2,955
questions
0
votes
2
answers
33
views
When will a laravel model creation fail without an exception?
I am adding a store method to a controller that will create and save a new model to the database using the following code:
public function store(Request $request)
{
$validated = $request->...
1
vote
0
answers
27
views
Remove error backtrace from laravel lighthouse response
I am using laravel lighthouse framework for GraphQL API, and I am trying to return error to the user.
How can I remove "locations" and "path" from the response? (I want to have &...
0
votes
0
answers
29
views
ffmpeg library resizing and uploading output file in the folder on localh but on server file doesn't upload after resizing
Here is my function:
try {
if (!empty($_FILES['file2'])) {
$files = true;
// Handle the file uploads
$files2 = $_FILES['file2'];
$maxFileSize = ...
1
vote
1
answer
38
views
How can my custom error handler detect if the same error will also be thrown by PHP as an ErrorException?
I'm trying to update an older application to make use of newer PHP 8.2+ features. Many internal PHP errors are now automatically thrown as ErrorException objects.
You can set up a custom function to ...
-8
votes
2
answers
166
views
How to get SQLite error in PHP/Laravel when quoted column does not exist [closed]
Related to my previous question, I found out that due to an error I made, Laravel generates a wrong SQL query:
select * from "companies" where "companies"."id" = '...
0
votes
1
answer
39
views
Using error_log("some message") not being written to error_log
I'm developing a plugin and trying to debug it. I've placed error_log statement is the parts of the code I suspect are causing the problem. But nothing is being written to the error_log file. I am ...
0
votes
0
answers
40
views
Giving a custom response to a MYSQL error [duplicate]
I seem to have a problem that others have reported but the answers provided in other threads do not work in my case. I have code to connect to my db and it works fine, I can use it to connect and ...
0
votes
0
answers
41
views
How properly handle error exception in try and catch block?
I have a problem with the flow of error handling. I have a try and catch block, and I need to ensure that the try block contains the logic for what should be executed. Specifically, a ticket should be ...
0
votes
0
answers
35
views
How to handle "429 Too Many Requests" error when importing products from cjdropshipping.com in a Laravel PHP store with Drop-shipping?
HP store with Drop-shipping?
Problem Description:
I'm facing an issue while importing products from cjdropshipping.com in a Laravel PHP store with Drop-shipping. I receive an error message
GuzzleHttp\...
0
votes
0
answers
43
views
Empty page PHP8.3 instead of error message output
The following code has a problem with the access level of $bla.
Normally I would expect the error output "Fatal error: Access level to mySlave::$bla must be public (as in class myMaster)". ...
0
votes
1
answer
18
views
php 8.1 + mysql 5.7: error handler in stored procedure dosen't work
I have a stored procedure with which I try to insert some data into two tables but I don't want to insert duplicate keys. So I wrote the following procedure with the handling of error 1062: duplicate ...
0
votes
0
answers
36
views
php8 how to properly define a errorHandler in a class?
In a class I use file_put_contents, which only gives a warning and not an exception to catch. The way to do it as I saw also in the docs is a callable function.
The examples I find are for non object ...
0
votes
1
answer
138
views
Warning: Undefined array key "login" [duplicate]
<?php
if (true == $_SESSION['login']) {
echo "HELLO..! Welcome";
}else{
echo "HELLO..! Please Log-in";
}
?>
the ...
1
vote
0
answers
80
views
Trouble Connecting to Network Printer in PHP: Connection Timeout Issue (Error Code 110)
Question:
I'm encountering an issue when trying to connect to a network printer (BC-99AC) using PHP. Here's the error message I'm receiving:
Cannot initialise NetworkPrintConnector: IP: 192.168.123....
1
vote
2
answers
658
views
How to fix "could not find driver" error in laravel 11
I got this error when starting my laravel project:
Illuminate \ Database\ QueryException
could not find driver
PRAGMA foreign_keys = ON;
This is the pict
I tried to remove the semicolon extension=...