Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-05-17 15:16:25
Point:500 Replies:15 POST_ID:828505USER_ID:11059
Topic:
PHP Scripting Language;;Linux
I get one php script, csvextract.php, as attached in code area, and I found the error message
"Fatal Error: Out of memory(allocated 3123000)(tried to allocate 71 bytes) in /home/.../csvextract.php line 17"
at the line 17 is exactly at file_put contents() function location.
And I already check my php.ini file and .htaccess file, those are already setting correct memory_limit=128M,
max_execution_time=0, max_input_time=-1, so I believe the error message is NOT related to
memory_limit, max_input_time, max_exexcution_time.
SO what other factors or setting in php.ini will affect the file_put_contents() function ? Is the fatal error
related to magic_quotes_sysbase() and magic_quotes_runtime() ? I got confused about how to use
magic_quotes_sysbase!
When I cut down the file of "data.csv" file size by half or number of row in the file by half,
it is passed and no any error message.So I suspect $csv variable to store the array from file() can NOT
be too much size. Do you think so.? Is there any setting in php.ini related to parsing variable size like $csv as follows
Be reminded my fatal error message is out of memory(allocated 3123000)(tried) and NOT "Allowed memory size 100k exhausted"
If memory_limit is not set correctly, it will report error like " Allowed memory size 100k exhausted" for example only
Please advise
Duncan
"Fatal Error: Out of memory(allocated 3123000)(tried to allocate 71 bytes) in /home/.../csvextract.php line 17"
at the line 17 is exactly at file_put contents() function location.
And I already check my php.ini file and .htaccess file, those are already setting correct memory_limit=128M,
max_execution_time=0, max_input_time=-1, so I believe the error message is NOT related to
memory_limit, max_input_time, max_exexcution_time.
SO what other factors or setting in php.ini will affect the file_put_contents() function ? Is the fatal error
related to magic_quotes_sysbase() and magic_quotes_runtime() ? I got confused about how to use
magic_quotes_sysbase!
When I cut down the file of "data.csv" file size by half or number of row in the file by half,
it is passed and no any error message.So I suspect $csv variable to store the array from file() can NOT
be too much size. Do you think so.? Is there any setting in php.ini related to parsing variable size like $csv as follows
Be reminded my fatal error message is out of memory(allocated 3123000)(tried) and NOT "Allowed memory size 100k exhausted"
If memory_limit is not set correctly, it will report error like " Allowed memory size 100k exhausted" for example only
Please advise
Duncan
my csvextract.php========================================<?phpini_set('max_execution_time', 0);ini_set('max_input_time', -1);ini_set('memory_limit', '128M');ini_set('post_max_size', "128M");ini_set('upload_max_filesize', "128M");$csv=file("data.csv");$e=count($csv);$line=array();for ($a=$e-1; $a > 0; --$a) {$line= explode(",",$csv[$a]);$line[4]=$line[4]+100;$line[36]="a";$line[37]="aa";$line[38]="bb";$line[39]="cc";$line[40]="";$csv= implode(",",$line);}file_put_contents("data.csv",$csv);?> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:
Author: duncanb7 replied at 2024-05-22 20:19:38
Dear Ali,
I am sorry I misundstood your
writing or meaning. Finally
it proved your reply is correct
ulimit -a , and I have checked
the max locked memory is limited
by host company in this thread
as follow
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_27052240.html
Anyway, thanks for your reply and
trigger to find out the final rea
son and answer
I am sorry I misundstood your
writing or meaning. Finally
it proved your reply is correct
ulimit -a , and I have checked
the max locked memory is limited
by host company in this thread
as follow
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_27052240.html
Anyway, thanks for your reply and
trigger to find out the final rea
son and answer
Expert: _alias99 replied at 2024-05-22 12:15:57
Author: duncanb7 replied at 2024-05-21 04:33:57
Dear Adm,
Please help to reactivate this thread and I get the final answer to this thread
Please help to reactivate this thread and I get the final answer to this thread
Author: duncanb7 replied at 2024-05-18 03:49:25
It is same as before if change to
ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
ini_set("max_execution_time", 0);
ini_set("memory_limit", "10000M");
It seems the system not allow $csv is too big in memory from
file_put_contents("data.csv",$csv);
ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
ini_set("max_execution_time", 0);
ini_set("memory_limit", "10000M");
It seems the system not allow $csv is too big in memory from
file_put_contents("data.csv",$csv);
Author: duncanb7 replied at 2024-05-18 03:22:27
The file size of data.csv is just below 1meg byte only
Expert: vimalmaria replied at 2024-05-18 01:21:02
Hai,
use the below lines on top of ur pages
ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
ini_set("max_execution_time", 0);
ini_set("memory_limit", "10000M");
use the below lines on top of ur pages
ini_set("user_agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
ini_set("max_execution_time", 0);
ini_set("memory_limit", "10000M");
Author: duncanb7 replied at 2024-05-17 16:44:50
I am sorry to you and because I got a lot experience there is a lot of people who just play it aroud not serious.
please stay these thread and I will re-open this thread , your last thread is more kind and more show to others
that you are sincerely to help others because of more explaination.
I will follow your suggestion no matter that is right and wrong because you are serious to reply this thread
please stay these thread and I will re-open this thread , your last thread is more kind and more show to others
that you are sincerely to help others because of more explaination.
I will follow your suggestion no matter that is right and wrong because you are serious to reply this thread
Author: duncanb7 replied at 2024-05-17 16:38:10
Hope you can help and be serious to ask and write down what you are asking in detail at least more words for
other people to be understood
other people to be understood
Expert: a1j replied at 2024-05-17 16:37:01
This is probably error returned from malloc which means that probably OS denied allocation. Why? Because your ulimit can be set to low numbers.
But I will not follow this thread anymore - you are very rude and need to learn how to work with people.
But I will not follow this thread anymore - you are very rude and need to learn how to work with people.
Author: duncanb7 replied at 2024-05-17 16:32:41
If you think so, it is not, just hope you conside and read the thread title in detail before you making any fast comment
Expert: a1j replied at 2024-05-17 16:25:16
Oh you asking for help and threatening people at the same time? Good luck :-)
Author: duncanb7 replied at 2024-05-17 16:18:05
Any suggestion, please conside and read the thread title in detail before you making any comment
Author: duncanb7 replied at 2024-05-17 16:11:47
If you keep answer this way, I will ask EE adm to stop your behaviour or account
Author: duncanb7 replied at 2024-05-17 16:10:38
ulimt -a is for nothing and not the subject of this thread
Accepted Solution
Expert: a1j replied at 2024-05-17 16:04:42
500 points EXCELLENT
what is
ulimit -a
for the user that executes web application?
ulimit -a
for the user that executes web application?