logs archiveIRC Archive / Freenode / #php / 2006 / May / 24 / 1
slugger
Pollita: libpng-devel is installed on my system, is there a way I can tell it where to look? Though it's in /usr/lib/, but might be worth a shot?
richardlynch
Renich: http://pastebin.com/733809
Renich
anyone? any clue?
oh
saved richardlynch
Ricky28269
Hi, is there a way to make PHP and Apache not send a huge amount of headers?
Renich
yeah, just set DontSendHugeAmountOfHeaders = 1 on php.ini...
Ricky28269
Because I'm making a page that updates automatically using JavaScript, with a sort of "heartbeat" system, and it appears that every heartbeat, my code only returns "0" or "1" but the headers are a huge blob
richardlynch
Ricky28269: So have it skip all the headers and ignore them? Or maybe find a function/switch in JS to do that for you?
Renich
are you using pics on that from a db or something?
Ricky28269
Well I'm doubting it's JavaScript's fault...
things like the Date header and Server header are unnecessary
         

Renich
richardlynch: so? what's the problem with my little color_table?
richardlynch
Ricky28269: You can turn off Server in php.ini, I think... And maybe header("Date:"); will suppress date header?
Ricky28269
Date: didn't work
also X-Powered-By is completely pointless
richardlynch
Renich: *SOMETIMES* it's an array, and *SOMETIMES* it's a string like "a" -- I cannot fix your algorithm that crams arrays and strings all willy-nilly into the data structure, but that's what you've done. Scroll down past the zillion arrays, and find the Warning lines.
Ricky28269: X-Powered-By: can definitely get changed in php.ini
JJPeerless
can anyone suggest a good/reliable vps hosting service?
richardlynch
The rest are in Apache httpd.conf, probably.
Renich
ok, I see your point... let me try and fix this stuff
Ricky28269
Okay, well thanks
Stormchaser
JJPeerless: You should know better than ask this here.
phishy
hello, has expat been removed from standard php5 distro completely, or is there a way to install it?
Apocs
Im getting an HTML validation failure when I put <something> in my mysql db and echo them out on a page because og the < > how can i prevent this?
phishy
php.net/htmlentities
richardlynch
Apocs: Call htmlentities() on the data right before you print it out to the browser.
slugger
Pollita: I installed pslib from source and the extension then installed with no errors.
Apocs
ok, thank you richardlynch :)
||cw
slugger: you could have install pslib-dev package
TheWarden
Is there a way to pass a value to a require_once() file?
richardlynch
TheWarden: Pretty much all your variables are already there...
phishy
will expat show up in phpinfo in php5?
TheWarden
richardlynch: well I'm passing a value via the query_string.... so I'm using $_GET. Mmm maybe I can just set the value before require_once().
         

||cw
TheWarden: include/require works like copy/pasting the code from the included file into the current file, there is no concept of "passing" there
TheWarden: you can just use $_GET in the included file
richardlynch
TheWarden: $_GET will still be there. And any other variables you used.
TheWarden
||cw: not in my case, as due to the way I have mod_rewrite configured I have to handle 404 errors... yeah I feel dumb no bring this up... I just was not thinking. It works fine now.. geesh.. I'll go shrink away now.
nmatrix9
anyone know any good tutorials on building php scrapers?
phishy
screen scrapers?
richardlynch
nmatrix9: http://php.net/curl :-)
phishy
use tidy
its great for screen scraping
John Coggeshall's web site has some talks
FatalRemedy
Im having a little problem with pear on this new server.
richardlynch
How well does Tidy handle *bad* HTML spit out by other servers?...
FatalRemedy
just copied the code to new server, and I get this error: Warning: main(): open_basedir restriction in effect. File(/usr/lib/php/PEAR.php) is not within the allowed path(s):
www.yellowlocalpages.com/phpinfo.php if ur curious.
Any ideas?
phishy
screen scraping is full of holes
Kartagis
good night
phishy
you make due
witrh tidy you can navigate the html dom
richardlynch
FatalRemedy: PEAR.php is not within the directory structure your host wants you to use for your PHP files. move it, copy it, or change open_basedir in php.ini
Stormx2
hi phpers
FatalRemedy
richardlynch, thanks alot man. I'll contact my host.
phishy
or install your own PEAR
its easy
Stormx2
I have a pear
lilkid
if the user has cookies disable will sessions not work for that user?
phishy
they will work by appending sessionid to the urls
Julian|Work
If you're using the cookie method, yeah.
You can set a flag in php.ini to have the session ID passed through URLs automatically, i.e. index.php?section=new&PHPSESSID=d41d8cd98f00b204e9800998ecf8427e
session.use_cookies = 0
phishy
i thought it tried both by default
nmatrix9
richardlynch: I was thinking more a structured tutorial not a manual . . . but I guess I'll read the comments
Xyphoid
That trans_sid stuff is bad news. yay for passing session ID's around through referer and bookmarks and emailed links.
richardlynch
nmatrix9: Yeah, that's why I had a smiley. You may be able to find a tutorial with a Google -- But the info you need IS in there if not.
nmatrix9
richardlynch: yeah the comments are very handy
lilkid
Julian|work: i dont have access to the php.ini im on a shared server, is there any way around it?
richardlynch
Xyphoid: Which is why your session IDs and what not should expire quicker if you use trans_sid, and why you should challenge for password before anything REALLY serious, no matter what their cookie/URL says.
xst
Has anyone any experience of running MULTIPLE apache webserveres in parallel with php? I think of some DNS load balancing. My concern is: If I use session variables in my php scripts, how would these function on such a DNS loadbalancing setup? Will the browser cache the first IP-address it resolves (so that the same session is reached at every request)?
richardlynch
lilkid: .htaccess often will be enabled for you to change some settings.
phishy
xst: write a custom sessions handler to use the db
mattmcc
xst: Sessions have nothing to do with the client's IP, they're propogated by request data (Typically a cookie)
lilkid
yep it is, ok thanks :)
richardlynch
xst: You need to get the session data into shared storage somehow. db is okay up to a point, but on SUPER busy server, db can slog you. MCacheD or MemCacheD or somesuch is a good solution to this one, according to a talk I just attended...
caffinated
xst: if you're worried about hitting different machines, you should look at using memcached as your session store
Xyphoid
some load-balancing setups will do server affinity so future requests will keep going to the same node
we go with the mysql session handler instead
richardlynch
You should NOT rely on server affinity to save your ass -- Assume any one of the boxes *WILL* go down at any time.
caffinated
xst: the advantage of memcached is that it is very easy to add more machines. mysql and most other alternatives do not allow for this.
Stormchaser
richardlynch: That's true. Tested :)
Xyphoid
we probably would have gone with memcached now - we're using it for other projects and it's lovely.
phishy
now that the smart ones wokre up.. whats up with expat and php5.. is it in there?
xst
Thanks for all the good replies. I actually planed to use memcached already, but not for session storage. Maybe I should look into that
richardlynch
phisy: Still don't know. Sorry.
phishy
hehe, dang
three time sthe charm. i'm out
richardlynch
phishy: Google for like PHP 5 Roadman or somesuch, or ask on Internals.
emulatore
hi, how do i convert á to รก?
php has some function for that?
caffinated
emulatore: html_entity_decode
richardlynch
emulator: http://php.net/htmlentities has a link to it.
emulatore
thanks
xst
But using memcached as session storage requires some sort of custom session handler as someone in here said, right?
richardlynch
xst: Yes, you will still need that.
caffinated
xst: i'm pretty sure there are bindings for it
xst
(I need to make sure that the session IDs really is unique)
||cw
xst: yeah, not hard to make one though
xst
I'll go goole it. Thanks for the advices!
goole = google
Stormchaser
goole = goo :)
archivist
Goole is a grotty town in England
Stormchaser
lol
Oyst3X
(Action) ...
Burian
hey can someone tell me what I am doing wrong here
$bots[2] = ["googlebot","<a href='http://www.google.com'>GoogleBot</a>"];
Stormchaser
Oyst3X: yes?
Burian: Ummm... php.net/array
richardlynch
Burian: http://php.net/array
hacked`
Burian: http://php.net/array
Burian
thank you all for the link
Oyst3X
[Stormchaser]: =]
[strobedream]: yeahh
richardlynch
LOL
Stormchaser
*blink*
mattmcc
Scary thing found in somebody else's code: A not quite infinite, but extremely deep recursive operation in an object that generates an HTML table, which results in the page failing to render. In fact, it prevents the server from sending an HTTP response at all.
Why didn't anybody else notice it? Because I'm apparently the only person to ever run this code with a PHP memory limit of 8mb. Apparently, production sets it to 64mb.
fuffalo
is there something i can use to check if pre_replace replaced something?
nmatrix9
mattmcc: bloat
fuffalo
so that i can set a flag
nmatrix9
mattmcc: was this website owned by M$
?
richardlynch
fuffalo: $original = $string; preg_replace(...); if ($original != $string) echo "changed.";
mattmcc
nmatrix9: Insane bloat. It's runaway recursion that just happened to work itself out in the memory limit everybody else was using.
Stormchaser
fuffalo: you want preg_match
fuffalo
richard than you
richardlynch
What moron uses recursion to make an HTML table in the first place? sigh.
Stormchaser
richardlynch: It really depends on the purpose.
archivist
sorting a table rather than using order by on the db server?
richardlynch
The DB *has* to be faster than PHP for sorting, or you've done something even more wrong in the DB...
Oyst3X
XP
Fushuing
how do i tell ftp to only read the LAST line of a file?
archivist
ftp==FILE transfer protocol not line
Vyusher
Howdy folks, is there a fast way to update PHP to the latest version via terminal?
Stormchaser
Fushuing: you don't?
Tresnar
Fushuing: That's not entirely possible within the FTP spec. The best you could do, is manually guess where you would need to resume the file to get the last line.
Fushuing
eeer
tell PHP to only read the LAST line of a file XD
Stormchaser
Vyusher: apt-get upgrade php
Vyusher
I've just installed OS X 10.4.6 and it has PHP 4.4.1 on it currently.
Fushuing
i've been ftping too much today :|
Vyusher
Great thanks Stormchaser!
Stormchaser
Fushuing: fopen / fseek
Fushuing
i looked at those
Vyusher
Stormchaser, just tried it and it said, "-bash: apt-get: command not found"
Stormchaser
Fushuing: You'd be probably best off by using 'tail'
richardlynch
Fushuing: fopen/fseek(filesize())/ loop: fread(-1) === "\n"
Fushuing
there is no tail() in the documentary
Stormchaser
Fushuing: ...
« prev 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 26 next »