Koozali.org: home of the SME Server

Problem somewhere but where...?

Offline BlueLake

  • ***
  • 56
  • +0/-0
Problem somewhere but where...?
« on: July 18, 2008, 06:37:50 PM »
 :sad:Before I start let me say I have read the manual, I have searched the forums(for about five days now) and still I am unable to find the answer. So let me explain. I have created a few iBays and have the correct dns working I have create web sites and placed them in the relevent iBay. I have installed postgress as per the howto and this works.

I have created a new file (as mentioned in the forum...) and also expanded the phpini file... with extension=pgsql.so and this works. Also did the same with the httpd.conf (i believe this is working) for the php files. edited the pg-hba and postgres files accordingly these also work.

I can access the postgres database from a windows xp client so I know the database is working. On web site is using only php files and they are diplayed - so php seems to be configured correctly. Exactly the same set up on a development client and everything works as it should.

So the problemmmm is accessing the database from the sme ibay using php. Php is working because it returns a file just before the access string is used to return a dataset from postgres. The httpd has been restarted, postgres has been started. Using pgadmin i can access the database using the same connection. I can run the web app under windows with apache and php installed. Under windows I had to point the httpd.conf to the php.ini file does this also apply to sme server? or have i totally screwed the settings up expanding the ini file? with the templates-custom i created. I dont think this is even a socket / ip thing. I have read the error logs but must confess I am not really sure what I am looking for. Every thing appears to work up to the point where php has to access postgres. Any help that would point me in the right direction would be more than welcome.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Problem somewhere but where...?
« Reply #1 on: July 18, 2008, 07:25:00 PM »
So the problemmmm is accessing the database from the sme ibay using php. Php is working because it returns a file just before the access string is used to return a dataset from postgres. The httpd has been restarted, postgres has been started. Using pgadmin i can access the database using the same connection. I can run the web app under windows with apache and php installed. Under windows I had to point the httpd.conf to the php.ini file does this also apply to sme server? or have i totally screwed the settings up expanding the ini file? with the templates-custom i created. I dont think this is even a socket / ip thing. I have read the error logs but must confess I am not really sure what I am looking for. Every thing appears to work up to the point where php has to access postgres. Any help that would point me in the right direction would be more than welcome.
My guess is to check the /var/log/messages file as I think you might be running into the PHPBaseDir restrictions, normally these clues would appear in that file. (see http://wiki.contribs.org/PHP#Open_basedir_restriction for more infor on that).
Another thing could be that there is some sort of PHP error occurring, this should normally be written in to the /var/log/httpd/error_log file. Have a look in that one as well.

Another thing you could do while debugging is to configure PHP to display error messages on screen, this is disabled by default as a security measure. Here is the instruction to temporary enable it: http://wiki.contribs.org/PHP#Display_Error_Messages (the same page as the first link only a different section :-) )
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: Problem somewhere but where...?
« Reply #2 on: July 18, 2008, 10:53:20 PM »
Hello Cactus and thank you for that quick reply...I did as you suggested and displayed the errors (also checked the log files you recommended) The error displayed is ...Warning: pg_connect(): Cannot create new link. Too many open links (0). I googled this error and it appears to be a PHP problem as such, and concerning the line (which I took great care to add using templates-custom) which is extension=pgsql.so - there is also another file (pgsql.ini) in directory /etc/php.d/ which redhat introduced which also has this line. Apparently one of them has to be removed to resolve the issue, the question is which one. So I commented out the line in php.ini file which only threw up more exceptions, I am a little reluctant to remove the original. mmmm   

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Problem somewhere but where...?
« Reply #3 on: July 19, 2008, 12:42:00 AM »
Apparently one of them has to be removed to resolve the issue, the question is which one. So I commented out the line in php.ini file which only threw up more exceptions, I am a little reluctant to remove the original. mmmm   
The pgsql.ini file is irrelevant and not picked up by SME Server, could you be so kind to post the contents of the custom fragment you created as well as the pgsql.ini file. I guess we need to combine those two to get things working.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: Problem somewhere but where...?
« Reply #4 on: July 19, 2008, 09:53:55 AM »
Hi - Well the good news is at last it is working. So what did I do. I commented out the line in the php.ini which says - extension=pgsql.so - restarted apache - checked the pg-hba.conf (just to make sure) and restarted postgres, again just to be sure, and now things are playing properly. The question now is why it wasn't doing this to start with???.

The originall quest was have php / postgres / apache all talking to each other, as I have under a windows OS. Browsing the forum I came accross a similar post which I thought maybe worth a try. As follows.

mkdir - /etc/e-smith/templates-custom/etc/php.ini
add file 70PgsqlExtension
add one line extension=pgsql.so

expand the php.ini file with
sbin/e-smith/expand-template  /etc/php.ini

Before this nothing happened with postgres, after I expanded the template the error appeared. There also seems to be a generall acceptance that - extension=pgsql.so - is a requirement for all this to work. Again this makes sence to me assuming pgsql.so is the equivelent to windows php_ggsql.dll (maybe !).

Searching google with the error confirmed it was in fact a PHP error because there was two files with the line - extension=pgsql.so. removing this from php.ini has things working. So has expanding the templates-custom somehow awakened the redhat file.!!!
   



Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Problem somewhere but where...?
« Reply #5 on: July 19, 2008, 09:58:12 AM »
Searching google with the error confirmed it was in fact a PHP error because there was two files with the line - extension=pgsql.so. removing this from php.ini has things working. So has expanding the templates-custom somehow awakened the redhat file.!!!
I find that hard to believe, for sure Apache and PHP should not be reading other configuration files unless explicitly told to do so. Based on what I see from your configuration you did not do so...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)