PHP Whine-post
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
Yes, this is more whining from my part, so I'm actually expecting someone to react
I just got a bit stumped when I "upgraded" php on the server here, and everything stopped working.
I can't say I'm shocked, but I'm mildly irritated. There was alot of hassle with the upgrade, as several things stopped working unexplainable. First I tried to downgrade the extensions, but then PHP complained that the modules where compiled for another version (isn't one point with DLL's that they're version independant?) then SSL stopped working because the other dll (OpenSSL, ssleay32.dll) and all was chaos. And what I don't understand is that they continue to do this, forcing people to rewrite entire applications because they did a horrible job at planning the structure of php in the first place. We needed to upgrade because we experienced alot of trouble with the SOAP library (php_soap.dll) which is utter rubbish
Alltogether this resulted in a 2 hour downtime for all PHP applications on our server. (as I had to figure out what the fuck was happening, and what I could do about it)
ASP.NET downtime : about 2 seconds when we upgraded from 2.0 to 3.5
On a whine-sidenote : strpos is bullshit. Why on earth does it return false? They have a lot of stupid explanations on php.net, like "returning -1 would be bla bla bla against the rest of php standard"... Why do they name it the same as C does, and then make it work differently? So instead of the version all programmers are used to (if the string is not found, return -1) they do it their own way, so EVERYBODY has too look it up. Check the bug-report list for strpos, see how many that have "falsely" accused it of misbehaving. The problem as far as I see it, is that these string comparison functions need "special attention" from the developer, as I can't see that this is something many other functions do (except those who don't return 0, where false could be used because false == 0)
(in case you had this problem; you have to check the type of the result as well (false is a boolean), so you need to use the mysterious === )
Configuration of php is also pretty weird.. although I can't really complain about it, because it does the job. Problem is when you're developing on IIS on your own machine (not server os), is that when running ISAPI, you almost have to reboot your machine to make it reload the configuration (easiest is of course iisreset /restart) - don't use ISAPI on test/development environment
Anywaaaaaays, I just wanted to warn anyone that might have used the register_globals property in php.ini as this is removed in php 6 (it's the stuff that automatically puts request variables in named variables (for instance $_GET["test"] -> $test)). I've never used it, but my boss did for some of the php applications he wrote
So if you have some large applications that stop working (stopped reading querystrings and form data)
I wrote this little snip as a quickfix
foreach($_REQUEST as $key => $value)
eval("$".$key." = '$value';");
(horribly insecure, but it'll do the job until it's properly fixed. (you should escape quotes and any other nastyness))
I thought this might save you alot of headache, if you're in the same position as I ;)
"no sound in ass"
- elbekko
-
elbekko
- Member since: Jul. 23, 2004
- Offline.
-
- Forum Stats
- Member
- Level 16
- Blank Slate
There's a good reason register_globals is being removed: it's horribly insecure and should have never existed. If you *really* need it, there's a better solution than that code snippet of yours, that doesn't use eval ;)
foreach($_SESSION as $key => $value)
$$key = $value;
But, I will personally kill anyone who uses that :P
About the DLLs... they keep working. I did the same on my local server, it whines when starting up, but it works fine.
"My software never has bugs. It just develops random features. " - Unknown
[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]
- henke37
-
henke37
- Member since: Sep. 10, 2004
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

