Solved [Solved] PHP, MySQL\Maria & Apache\Nginx "FAMP" not working

Hi,

I have recently evaluating various PHP projects that connect to a database and provide numerous services. The easiest examples, but not limted to, are www/owncloud & http://www.mytinytodo.net/. Once installed I have checked that the files are owned by www:www, with correct permissions.

For some reason I can not get these 'appliances' to work properly with FreeBSD. I have checked that PHP works by
Code:
<?php
phpinfo();
?>
Which all works fine. Also I have used databases/phpmyadmin fine. Created databases, assigned users, etc without issue. Have used this with both www/apache24 and www/nginx to see if there were any rewrite issues or differences in web-servers that may affect.

Finally, I installed Debian and tested through that to make sure that the projects themselves were not broken. Of course things worked without issue.

I find it odd that www/phpmyadmin works and other PHP projects don't. Especially with www/ownlcoud, as that installation contains all the relevant PHP extensions and dependencies. Am I missing something obvious?
 
Re: PHP, MySQL\MariaDB & Apache\Nginx "FAMP" not working

Have a look at your /var/log/httpd-error.log. You can usually find the reason why it's not working there. Most of the time it's a simple matter of a missing PHP extension.
 
Re: PHP, MySQL\MariaDB & Apache\Nginx "FAMP" not working

Yup! It was clean as a whistle! I am going to go back and re-read just in case I missed something!
 
Re: PHP, MySQL\MariaDB & Apache\Nginx "FAMP" not working

I've had similar issues with www/webtrees, it just failed to work and only gave me a blank screen. Nothing in the logs either. Turns out there were a couple of PHP extensions missing in the dependency list. So they never got installed. It can be a bit tricky to find if there's nothing in the log files. Have a read through their documentation and try to verify if you have all dependencies installed. The port may just be missing some.

If you have a working Debian install you can also have a look at what it's dependencies are on there. Package names may differ a little but it's usually quite comparable.
 
Re: PHP, MySQL\MariaDB & Apache\Nginx "FAMP" not working

Yes, I also suspect that dependencies are missing. Some of the projects I am looking at don't have great documentation, some do; however, you have given me an idea. :beer

If I compare the dpkg --list from the working Debian machine and the pkg info from the FreeBSD system I could spot any PHP extensions missing.
 
Re: [Solved]PHP, MySQL\MariaDB & Apache\Nginx "FAMP" not wor

Well, I improved on my previous idea of comparing dpkgto pkg and compared the output of phpinfo(); command.

To my immense annoyance and frustration I noticed databases/php5-mysql was missing. Installation of that port and things seemed to work! Arrrghhhh!

To round things off fully the port databases/php5-mysqli was installed and this explains how databases/phpmyadmin was succesful in running.

I suppose a follow-up question would be can you set databases/php5-mysqli as the preferred method of of interrogating MySQL\MariaDB? I heard it gives better performance or is this something that is set by the PHP project? I think it is probably the latter.

Many thanks to @SirDice for his help and inspiration!
 
Last edited by a moderator:
Re: [Solved]PHP, MySQL\MariaDB & Apache\Nginx "FAMP" not wor

As far as I know mysql and mysqli use slightly different commands, so it won't be an easy drop-in replacement. And both PHP modules are going to be deprecated in the next version of PHP. Hopefully by that time ports depending on them will have switched to PDO.
 
Back
Top