[PLUG-TALK] Finding PHP Expert

Ronald Chmara ronabop at gmail.com
Fri Apr 8 04:20:30 UTC 2011


On Thu, Apr 7, 2011 at 4:35 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> On Thu, 7 Apr 2011, Russell Johnson wrote:
>> That might make it a dead end. But... Have you found any error messages in
>> the apache or postgres logs?
> Russell/Wes:
>   Here's the latest. I tried a test script sent to me
...
> if (!($conexion = pg_connect("dbname=$dbbase port=5432 user=$dblogin
> password=$dbpassword")))
> { echo "Cannot Connect"; }
...
>   The browser is a blank page.

You can tack on:
 else {
echo 'Connected';
}

If you want some output...

> However, in /var/log/httpd/access_log is
>
> 127.0.0.1 - - [07/Apr/2011:16:23:08 -0700] "GET /test.php HTTP/1.1" 200 220
>
> which I have been told means it's an adodb driver issue.

Looks like PHP is *connecting* to postgres with native DB driver
libraries, at least? Have you tried to run a SELECT statement to rule
out internal DB permissions issues?

>   Running phpinfo() there's nothing about postgres in the database section,
> but pgsql is shown in the configuration section. This makes no sense to me.

Well, the above seems to be connecting... are you wondering why
there's a pgsql section but no postgres (or postgresql) section? PHP
naming conventions are the stuff of legend.... and not all legends are
pleasant, or sensible.

So, a wee bit of history about that: About 10 years ago, the PHP
documentation, and internal code, was an absolute mess of naming
conventions, with camelCase(), absurdlylongnamesforasimplefunction(),
shrtnm(), noun_verb(), verb_noun(), etc. For version 5 (which was in
development from 2002/2004, IIRC), a huge push was made to at least
make things *appear* more consistent, with the plan being to get rid
of all the old, divergent, naming variations in version 6 (to maintain
bc for a few years, with PHP 6 coming out around 2006/2007/2008-ish).

Version 6, of course, still hasn't come out... and as a result,
there's still lots of code floating around where sometimes components
are using very different naming conventions for the same thing (pg_
vs. pgsql vs. postgres vs. postgresql, for example).

This definitely belong on the list of "opportunities to improve PHP"
list, (aka, things that suck about PHP).

>   When I look for the adodb-pgsql drivers I don't find any:
...
>   This is probably a problem.

Does that mean you found your solution?

-Bop



More information about the PLUG-talk mailing list