$array[$i] doesn't contain any values!
| From: | Davor Cengija | Date: | Tue, 01 Jun 1999 12:45:00 +0000 |
| Subject: | $array[$i] doesn't contain any values! | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1218@lists.php.net to get a copy of this message | ||
i have a script which calls ls -a1
pwd in the directory
where the script resides and in for loop gives me the content
of the dir
------------------------
echo '<h2>Links</h2>
';
exec ("/bin/ls -a1 pwd", $content, $error);
if ($error) {
echo "error: $error<br>";
}
for ($i=0; $i<count($content); $i++) {
$a = $content[1];
echo $i." ".$a.'<br>';
};
------------------------
eny other combination of echo $content[$i] doesn't work as
well.
echo $content[1] has no values either.
this causes the server to die
-------------------------------
echo 'filling the array';
for ($j=0; $j<10; $j++) {
$polje[$j] = $j;
echo 'j='.$j.'<br>polje[j]='.$polje[$j]'.<br>';
echo 'veličina polja' . count($polje) . '<br>';
}
echo 'now display the array $polje';
for ($j=0; $j<count($polje); $j++) {
echo 'j='.$j.'<br>polje[j]='.$polje[$j]'.<br>';
echo 'size: ' . count($polje) . '<br>';
}
---------------------------------
[Tue Jun 1 14:32:49 1999] [notice] child pid 8584 exit signal Segmentation
fault (11), possible coredump in /opt2/davor/php4/apache
i would run httpd through gdb but somehow i dont have the man
page and don't know how to do it. explanation, please?
apache 1.3.6
i dont have to mention the scripts above works just fine with
php3.0.5 and apache 1.3.3
i have also problems with php4 compiled as a stand-alone
binary in parsing a big txt file.
php3 binary parses taht 50000 lines long file for about
220sec. php4 fails on ereg() call but i didnt have time to
experiment with it. expect the report tomorrow.
p.s. if there are any typos in the scripts, they do not exists
in the real version, con i typed the scripts into this
message, not copy/paste.
--
v
Davor Cengija
davor@linuxfan.com
====================================
"Please allow 30 days for delivery."