Re: [PHP] Too many open files

2003-01-10 Thread Rus Foster
On Wed, 8 Jan 2003, Macrosoft wrote:

> Can anybody explain me what does mean error:
>
> Warning: main(footer.inc.php) [function.main.html]: failed to
> create stream:
> Too many open files in /www/sql/main.php on line 96
>
> (phpPgAdmin 2.4.2 scripts, PHP 4.3.0 + Apache)
>
> Does PHP exceed any limit of opened files? How can I change the limit?
>
> Krzysztof Czuma
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

That looks more like a operating system limit. Can you check the SYSLOG on
the host at all?

Rgds

Rus
--
http://www.fsck.me.uk - My blog
http://www.65535.net - $120 for a lifetime UNIX shell account


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] tmpnam filename

2002-08-29 Thread Rus Foster

Hi All,
 I'm fairly new to this list/PHP and I've already hit a bit of a brick
wall. I'm trying to write some data out to a temporary file then make a
passthru call so that another program can take the file as input on the
command line

I first tried

 print "Do stuff";
   $temp = tmpfile();
   fwrite($temp, $text);
   passthru("/path/to/program $temp");
   fclose($temp); // this removes the file

However I realised that $temp was a file handle rather than a filename. Is
there anyway I can get the filename? A google and search on php.net
doesn't show anything obvious

Rgds

Rus

--
http://www.fsck.me.uk - Rant wibble wave
http://shells.fsck.me.uk - Hosting and stuff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Parsing RDF files help needed?

2002-09-26 Thread Rus Foster

Hi All,
 I've been playing with parsing RDF/XML files using PHP (code snippet
below). However I'm having trouble trying to work out how to actually
format the results in an order. My source is in the form


Politicizing Science
http://slashdot.org/article.pl?sid=02/09/17/0349219


Now I could easily cope with it if it was link, title as I would just
print $title. However I just can't work out a way of
doing this, this way. My attempt so far is below (mostly debugging code)

function startElement($parser, $name, $attrs) {
global $depth,$type,$title,$url;
for ($i = 0; $i < $depth[$parser]; $i++) {
print "  ";
}
$type = $name;
$depth[$parser]++;
}

function stopElement($parser, $name) {
global $depth,$type,$title,$url;
$depth[$parser]--;
print "depth parse = $depth[$parser] and  $title !! $url  ";
}

function characterData($parser, $data) {
   global $type,$title,$url;
   if ($data)
   {
switch ($type) {
case "ITEM":
case 'LINK':
   $url=$data;
case "TITLE":
   $title=$data;
}
}
}
$file="slashdot.rdf";

$fp= fopen($file,"r");

$parser=xml_parser_create();
xml_set_element_handler($parser,"startElement","stopElement");
xml_set_character_data_handler($parser,"characterData");

while ($data = fread($fp,4096))
xml_parse($parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($parser)),xml_get_current_line_number($parser)));

fclose($fp);


As you can see I'm trying to use global variables but I'm just really
unhappy with the quality of the code so any help would be appreciated.

Rgds

Rus foster
--
http://www.fsck.me.uk - Rant wibble wave
http://shells.fsck.me.uk - Hosting and stuff






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php