Forum

PHP Fatal error

MidGe
15 January 2013, 22:16
I am getting the following error when trying to run the setup database script:
"PHP Fatal error: ...call to undefined function mysqli_connect()...".

What is worse is that when I try to access a phpinfo page I put in the same directory as the index.html, I get a Forbidden page!

Any help would be appreciated.

Hiawatha version: current
Operating System: Ubuntu 12.10
MidGe
15 January 2013, 22:59
I should have said that it is when trying to implement Banshee that the problem occurs and that the database setup script is the one that comes with Banshee.

I have made, afaik, all the changes suggested in the docs and the various scripts of both Haiwatha and Banshee to no avail.

Unfortunately I could find no forums or documentation on the Banshee site either.
MidGe
15 January 2013, 23:36
OK, I found out I had to install the PHP extension. That got me thru the database setup. So, now I know that both PHP and MySQL are installed and working yet, I am still getting the forbiden page when trying to access the info.php file I added to the directory where the index.html file resides. That file has all permissions, just to make sure.

I have been trying to get this going for quite a few hours now and getting close to the end of my tether. I may have to give up and go back to a more conventional setup as my motive to try Hiawatha and Banshee was the focus on security. However it seems that with my knowledge, or rather lack of it, I should not rely too much on the security aspect as I obviously don't understand what I am doing or how it all hangs together and I may make a mess of it that would introduce vulnerabilities.

Anyway, any help in getting this further is appreciated.
MidGe
15 January 2013, 23:51
The error log shows a "CGI execution not allowed" when I try to access my phpinfo page!
MidGe
16 January 2013, 00:16
On the Hiawatha documentation page "HOWTO: Using CGI and FastCGI", it mentions a change required to a httpd.conf file. There is no such file on my system. Could that be the problem? If so, where is that file supposed to be located and what other content is there, besides the one suggested on the documentation page?
MidGe
16 January 2013, 07:15
Well, a few hours later, lots of fiddling with whatever I could in Hiawatha. Banshee, my DNS and others and I still have a problem. I think I tried everything!?

I still get a Forbiden when trying to access phpinfo page in default server but no problems when accessing the index.html in the default server. And I get a "Service unavailable" when trying to access the index.php in the virtual host for Banshee, but no errors in the error log and a seemingly valid entry in the access log.

I don't know where else to look or what else to change!?
Hugo Leisink
16 January 2013, 07:54
'httpd.conf' should have been 'hiawatha.conf'. I fixed it in the manual page.

Everything you need to know is in the CGI and FastCGI HOWTO page. The 'Service unavailable' error is because the PHP FastCGI daemon is not running or not configured correctly whereby Hiawatha can't reach it.

Banshee also needs PHP's XSL package (php5-xsl).
MidGe
16 January 2013, 10:16
Thank you for your reply, Hugo!

I have checked the page CGI and FastCGI HOWTO and I cannot see anything missing on my server.

I run hiawatha check which tells me " No Non-fatal errors".
When I try to access the info.php page on the default server I get a "Forbiden" from the server.
When I try to access the Banshee Virtual Host I get a "Service unavailable" from the server again.
The system log shows: "FastCGI Server PHP5 is still (partially unavailable)" which unfortunately gives me no clues about what the problem may be.
There is no error log produced.

Hugo Leisink
16 January 2013, 11:15
My guess is that you don't have a FastCGI daemon running. Check your running processes via 'ps auxf' at the command line and check if there's a process named php-fpm.

If not, make sure it's running. The CGI and FastCGI HOWTO contains a section how to start PHP as a FastCGI daemon via FPM. If that doesn't make it clear for you, check the internet for documentation. There is enough to find about FPM.
MidGe
16 January 2013, 12:23
Thanks Hugo,

It is one of the first thing I did check earlier on and I did again right now. There is a master process running owned by root and two pool processes owned by www-data running.



Hugo Leisink
16 January 2013, 13:34
Compare the 'listen' setting in your FPM configuration and the 'ConnectTo' setting in your Hiawatha configuration. They should match.
MidGe
16 January 2013, 15:11
Thanks again Hugo,

Yes, they both match.

I am going to give this a rest for now. Started more than 24 hrs ago with only a couple of hours in bed.

I may get back to this if I get some time later, but meanwhile I am going to try progressing this project in a different way.

Thanks very much for trying to help.

If I get any light about the cause of this problem I will post back here, rest assured.

Thanks again.
This topic has been closed.