[LUNI] Epic LAMP Fail

Clyde Forrester clydeforrester at gmail.com
Fri Sep 17 20:06:24 CDT 2010


Fortunately for my sanity, I still have a printout of the original 
failure. It says:

Greetings in Several Languages
Fatal error: Call to undefined function mysql_connect() in 
/var/www/HelloLAMP.php on line 8

It just wasn't understanding where it might find the mysql_connect() 
function.

Then I did a bunch of things. Then the error changed to:

Greetings in Several Languages
Fatal error: Call to undefined function mysql_select() in 
/var/www/HelloLAMP.php on line 9

Not a whole lot different, and not a very noticeable change. I wasn't 
looking for subtle change. I was looking to fix the "I don't know where 
the hell to find your damned function" error. I was looking for the 
error to go away completely. I was blind-sided by subtlety, so I'm not 
sure when it changed.

The first error was caused by a glitch somewhere in the interaction 
between Apache, PHP, and MySQL. Some configuration file, or maybe a 
missing module. There were no extra characters. There were no missing 
characters. Nothing to do with a typo. The editor didn't help. The 
online manual didn't help.

The second error was because the function should be mysql_select_db. 
That was where the problem was a typo on my part. Yes, an industrial 
editor would certainly help, but installing one is another, more 
advanced problem for another day. The sooner, the better, of course.

What I have learned is that an "I can't find your function" error can 
look EXACTLY like a "Hell, I can't even find your library" error. I 
consider this a communication problem, a bug, a defect. The error 
message could be doing a better job of resolving this ambiguity. It 
should be either "Library foo not found" or "Function bar not found in 
library foo".

As for me getting along with allegedly fool-proof systems: I'm that 
improved fool y'all have to worry about. :-)

c4
--
Program terminated because y0u 5ux0Rz, n00b. RTFM!

jjirsa at comcast.net wrote:
> Some editor that would cause underscore characters not to be 1 
> character?  I don't know...something that caused syntax errors but the 
> syntax "looks" correct.
> 
> If you saw the module information in the phpinfo() text, then the only 
> reason why you would get an error is because you have a typo. Maybe you 
> typed "mysql connect()" or "mysql__connect()"?
> 
> You don't get along with compilers or interpreters very well, do you? ;-)
> 
> Eclipse with the PDT is nice for editing code; the color coding will 
> show you any syntax errors.  Searching text in a project is faster than 
> grep at the command line.


More information about the LUNI mailing list