did anyone encountered a problem with excel_reader2, that the script got aborted by a big amount of rows, for example over 60k rows in the excel file? I just get an error message in error log : Aborted. Thats all. I got more files on my server and the script takes them 1 by 1 but when i get to the second the the message comes and script stops. Its php 5.4.7 btw.
I am not sure about the problem, but phpexcel does not really like large excel files, that may be a problem. Please try to limit the data with reading only chunks, it may help.
Related
I can not find any answer to this as most problems revolve around a file not existing or a delete process not working.
I have an FTP device where I generate a file with an PHP script. After that, I try to FTP in, get the file and after that, delete it.
This all works fine, I can connect, get the file and save it locally and then delete it. Except for one thing, the ftp_delete() function results in a warning.
PHP gives me the following, when executing the script:
A PHP Error was encountered
Severity: Warning
Message: ftp_delete(): Command okay
I looked up the error code, it means it was successful. And it was because the file is deleted on the FTP device.
So why does this generate an PHP error?
Cheers.
The RFC 959 (FTP specification) mandates that on a successful completion of the DELE command, the server should respond with 250 status code.
The PHP FTP implementation is very strict, yielding a warning on any other code, even if it indicates a success (2xx class).
Your server probably uses some other 2xx code, like a generic 200 Command okay.
I know how to download a file from a server using FTP with PHP.
I have a list of files to download from the ftp to an internal storage.
I use ftp_get() to download the list of files,
the first file size is: 126 mb, successfully downloaded to my internal storage.
However the PHP function throws an error 500, and then dies without continuing.
The error I get:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster#zzz.com and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error
log.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.
Any idea what I should do in order for the function to complete its run successfully?
You need to increase the timeout then. 180 is in seconds, which is 3 minutes. Try setting it to 600. I.e.: FTP_TIMEOUT_SEC, 600 or higher, depending on how much more time is needed. You probably could even try FTP_TIMEOUT_SEC, 0 which I think is NO time limit.
It is already commented for one more question similar to this. Please try this. It should work.
Maybe you exceeded the maximum execution time.
Try to increase it:
https://www.php.net/manual/en/function.set-time-limit.php
Every now and then an image resizing script on our site will fail with the following error:
PHP Fatal error: Class '\xa0L\xdaor\x7f' not found ... on line 4
The actual line 4 of the script in question is:
$photo = new Photo($photo_id);
I have no idea where the hex code \xa0L\xdaor\x7f in the Error log comes from. The script will run fine and it runs relatively frequently for a day or two, then it starts failing every time, with that error.
If I run opcache_reset(), the errors stop.
Anyone have any idea what might be causing this issue?
UPDATE: I got no response - so I've simply excluded this file from the opcode cache using opcache.blacklist_filename.
Sometimes my whole PHP response was a bunch of hex codes like this.
I had that when opcache.fast_shutdown="1" was set.
Okay so I'm trying to retrieve 130 XML files from a feed and then insert values into a database. Problem is, it crashes at around 40-60 entries and doesn't give an error. I timed it and the script goes for around 13 seconds each time.
I checked my php.ini settings and they are...
Memory Limit = 128M
Time Limit - 30 seconds
So what is causing this error? When I run the script on firefox it just displays a white screen.
EDIT - The error I'm getting on chrome is
"Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the
connection without sending any data"
Have you checked the memory consumption? Also could you do a writeline or output something to the screen to see that it's reading in the files? Add error handling around the read statement to see if it's failing on parsing the XML.
Can anyone explain me why 500 Internal Server Error coming when large amount of data is POST to a php file and the data is around more than 1 mb?
My best guess is that the file is exceeding your configured maximum file size. See http://php.net/manual/en/features.file-upload.php for various discussion and solutions for throwing a prettier error message.
As to increasing those limits, look at "post_max_size" and "upload_max_size" in your .ini file. You'll also likely need to extend the execution time of the script, via "max_input_time" and "max_execution_time".
You can set these in your .ini, or in code as well. See http://blogs.sitepoint.com/upload-large-files-in-php/ for more info.