PHP is Strange Voodoo

,

All I want is a simple database management program.

All I need is to create tables, rows, and fields, insert or edit data, things that aren’t always convenient on the mysql command line. (editing of data in particular.) The only decent program I’ve found is phpMyAdmin, which of course requires a web server and php. I’ve tried every native DB management tool in portage, and several not in portage, to avoid these requirements. They all bite ass. Even MySQL‘s own management tool is buggy and missing features. Is this really so difficult a request?!

Anyway – phpmyadmin decided to die yesterday, after I hadn’t used it for a month or so. The strange voodoo that commenced haunts me to this day.


First of all, I have php running through fastcgi sockets with lighttpd. The main problem I had last night was that php-cgi would always segfault (the dreaded signal 11) whenever lighttpd tried to spawn it. I fiddled with some settings and somehow managed to totally hose my computer. Lighttpd, which is certainly a nice product, has absolutely ghastly error reporting. It’s unhelpful to the extreme. (Not as bad as some others, but come on – we’re enlightened now, and lighttpd is a modern program.) It proceeded to log approximately 9872473 errors per second, filling up my hard drive in mere seconds. If you’ve ever experienced that without /var/log being on a separate partition, let me spoil it for you – it’s not all that fun. You can’t run anything to find out what’s taking up the space.

I fiddled a bit more. Now, php-cgi wasn’t segfaulting, but lighttpd couldn’t communicate with the sockets. Believe it or not, I was getting a “connect failed, connection refused” on my own socket. What, praytell, does my socket have to refuse? It’s refusing the process that created it. Genius.

Anyhow. I’m not sure if this is a Gentoo-related problem or not, but I’m hoping it’ll help someone out in the future. I tried running php-cgi in a console, and while it didn’t segfault, it was giving errors about a missing java.so file. Java? Integrating Java and PHP is the programmatic equivalent of putting two underfed pit bulls in a sleeping bag.

It turns out that something told PHP to load a nonexistent java module. All you have to do is delete the java-related files from /etc/php/cgi-php/ext* and ext-active. That will make php-cgi happy, which will make the fastcgi socket happy, which will make lighttpd happy, which will make your php apps happy. I need a nap.

Comments

10 responses to “PHP is Strange Voodoo”

  1. Evil Iggy Avatar
    Evil Iggy

    Please post something like this every week or two, so that the fortnightly urge to reinstall linux that I have been experiencing will stay suppressed. Thanks!

    Like

  2. redshift Avatar

    Well, two things – first, it’s not a Linux problem, it’s specifically PHP. I don’t care for PHP. There are worse things out there, but PHP is like Perl – ugly and designed only to serve its purpose.

    Second, it’s partly my fault. I just wanted a quick tool to do a few things, so I didn’t go about it the right way. If I were going to do it again, I’d just do a clean install of PHP rather than screwing with all the settings, and I’d probably use SCGI instead of FastCGI. (SCGI is the simplest, fastest way to run apps like this.)

    It’s no reason to not use Linux. Actually, aside from the one program that had unhelpful error messages, it’s much better than Windows for exactly the reasons above; namely, problems have a cause. You can’t solve things by rebooting. If something crashes, you can find out why, and fix it. This does, of course, require a tad bit of learning, but I much prefer a system that works reliably.

    Like

  3. linus Avatar
    linus

    Have you looked at DBVisualizer? It’s a Java application that provides a uniform interface to practially any database that supplies a JDBC driver. I use it when I’m on a computer that does not have the native db client software installed. According to their site it will work with MySQL.

    I’d also like to point out that you are exhibiting the typical Linux Geek inferiority complex when you snidely deride Windows’ error logging capabilities. To each their own. I’ve tried Linux and my impression of it is “Nice toy. Now I’m going back to an OS that works and let’s me play all the cool games.”

    Like

  4. redshift Avatar

    Snidely deriding? I’d say I have pretty good reason. Please read more about Windows’ error logging capabilities.

    I don’t see how it implies any sort of inferiority complex to point out that Windows leaves you with little recourse for its many errors. Errors in a *nix system can be traced and solved.

    I’ve used Windows all my life, and my impression of it is “Nice toy. How exactly is such a system so popular?” Oh right, uninformed and uncaring users and a monopoly in the business.

    Like

  5. Hulk Avatar
    Hulk

    You smug self righteous son of a bitch. You’re a damn nazi! Windows is the most superior system in the world, because it’s American! If you hate America, why don’t you just leave??

    Like

  6. linus Avatar
    linus

    Wow, you are upset that Windows required you to reboot. That’s what, 20 seconds out of your life? In return you get a fairly stable OS that works across a huge spectrum of hardware, runs a vast number of software, all without having to learn an arcane commandset.

    You are correct in that Windows users are for the most part uncaring and uniformed. You see that as a negative, I see that as a positive – you don’t have to babysit the OS, you just turn on your computer and do your work.

    Hulk, I’d almost say that was a troll, but I’ve read your Republican talking points rants before so I’m not positive. You can quite possibly be stupid enough to 1. completely misread my post, and 2. believe in the America Uber Alles mindset.

    Like

  7. redshift Avatar

    Hulk is the master of trolling. He will confuse you on so many levels that you might not realize it, though.

    And no, I’m not upset that Windows requires me to reboot. (Well, that’s not what I’m upset about right now, anyway. They claim they’re fixing that problem in Windows Vista, but we’ll see.)

    I was upset that there was no reason given for the reboot whatsoever. They could have been installing updates that I didn’t care for. It could have been some form of malware snaking its way into my system and requiring a reboot for full effect. Note also that I had no option – you can only say “yes” to that prompt.

    And I don’t have to babysit Linux. I never have. In fact, it requires far less maintenance than Windows to maintain a secure and stable system. (Or at least, as secure and stable a system as Windows will allow.) Note, also, that Linux updates are generally from a central source – your distribution’s maintainers. To update the software on your Windows system, you have to go to countless websites, downloading countless different styles of update programs, and hope it all works together. Not so with the package managers on Linux.

    I find even the qualified phrase “fairly stable OS” to be misleading with regards to Windows. Sure, it’s improved over the days of the 9x codebase, but there are still so many crash-inducing phenomena that it’s hardly reliable, and certainly isn’t reliable for any important function. Go check out Netcraft’s uptime rankings to see which operating systems are the most reliable; only 4 out of the top 50 are running Windows. A *nix machine will not go down without cause.

    You can also put Linux on almost any hardware known to man; far more than Windows. Windows runs on x86 machines and some specialty machines only. Linux and Unix run on just about any machine anywhere, and do it more efficiently I might add. Several Linux distributions, and especially NetBSD, are renowned for running on any possible hardware you could have.

    Sure, Windows has a large base of commercial software. How much of it is useful, quality software that people use? And would you pay for it all? Oh, and mind you, you’re paying for a license to use their software, not the software itself. I’d also like to note that software (and even OS modifications) are far easier to write on Linux. You can see all the code that your machine is running. You can write (or have written for you) software more easily and more efficiently than on Windows. Not to say that Linux doesn’t already have a huge base of applications that cover almost any possible need, and certainly the needs of any home user. We won’t get into the many specialized areas where there is no Windows equivalent of a Linux solution.

    Arcane commandset I’ll (sort of) give you. But you know what? You never have to see it if you don’t want. You can live merrily with a nice graphical interface akin to Windows, albeit one that’s surprisingly fast and stable. The command line is an addition to that for such a user. If you want to learn its syntax, amazing power is available to you. But it’s never required. Plus, there are many shells available designed for new users that are easy to use and powerful.

    Now. I’m not saying that Windows is complete crap and is only popular because of Microsoft’s monopoly. They design software for a certain audience. Many people fall into this audience. They’re the type of people who buy a new computer because their last one clicks when it’s supposed to clack, or any tiny (fixable) problem comes up. Windows comes with almost every computer you can buy today. This tax just firmly plants the OS in the users’ minds. If everyone had a genuine choice of OS, I make no claim that everyone would switch to Linux, Unix, or anything else. Windows just fits some people. But it would have nowhere near a 95% marketshare.

    Like

  8. Hulk Avatar
    Hulk

    YAY! I actually give a crap about a techie post for once! Linus, be careful with the America Uber Alles stuff-first of all, no one likes French. Second of all, you shouldn’t confuse being anti-nationalistic (good) with being the only jackass at Yankees stadium wearing a Red Sox cap (sad).

    And I see the Windows/Linux thing like this: Ready made meals at a good grocery store. You know the kind. The nicer grocery store where you actually don’t have to smell the produce, which has a nice little section of ready made and almost ready items for you to purchase in a hurry. Perhaps you are on your way to a party and need a cheese plate of some sort. Or perhaps you’re hungry and would like some chicken french (Frenchie). The problem is that it sucks. It’s convenient, and it’s food, but it’s boring and tasteless. The alternative would be cooking. Sure its a bit more work, but its always more flavorful.

    I’m sure redshift will disagree with me, but he does that no matter what I say.

    Yay for me commenting on techie crap!

    Like

  9. redshift Avatar

    I think the sky is falling! Hulk commented on techie crap! And actually, that’s a pretty good analogy.

    Like

  10. Hulk Avatar
    Hulk

    I think your comment is arithmoqined. Your statement in and of itself reinforces itself. Specifically, the second and third parts reinforce the first part. Okay maybe not arithmoquined. Eyerahnik.

    Like

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s