# No PHP PDO MySQL support



## arie01 (Aug 7, 2012)

Hello there, 

I installed FreeBSD 8.2 that I want to use as a Nagios server. So, I installed AMP and Nagios and everything seems to be working fine. I wanted to add the lilac frontend configurator and even that went well.

However, when I go to http://myhost/lilac/install.php, the lilac configurator dependency checks page comes up with a few dependencies that need to be resolved before lilac works properly. I managed to resolve most of them except PHP PDO MySQL Extension, CLI Process Control Support and CLI PDO MySQL Support. 

Does anybody know how to install those?

By the way, I installed PHP Version 5.2.17.

Thank you in advance,


----------



## SirDice (Aug 7, 2012)

databases/php5-pdo_mysql

PHP 5.2.x has been End-of-Life for quite some time. FreeBSD 8.2 went End-of-Life last week.


----------



## arie01 (Aug 7, 2012)

Hello SirDice, 

I did that and I got 

```
host# make install clean
===>  php5-mysql-5.4.5 cannot install: doesn't work with PHP version : 52 (Doesn't support PHP 4 52).
*** Error code 1

Stop in /usr/ports/databases/php5-mysql.
```
Is there a way to correct that?

Thank you,


----------



## arie01 (Aug 7, 2012)

About the end of life thing, I can try to do the same on FreeBSD 9, but I'm sure I'll get more errors on my configurator dependencies check.


----------



## SirDice (Aug 7, 2012)

All versions of FreeBSD use the same ports tree. Besides, PHP 5.2 would still be deprecated. Changing the OS version doesn't change that fact.

Install lang/php53 or lang/php5.


----------



## arie01 (Aug 7, 2012)

Hello SirDice, 

Do I have to uninstall the currently installed version of PHP before I install php5 or php53?
How do I uninstall a package properly? I'm relatively new to Non-Windows OSs and I'm not familiar with the process of uninstalling packages or applications on FreeBSD.

Thanks again,


----------



## ph0enix (Aug 7, 2012)

You really want PHP-5.45.  If you have  portupgrade installed, you can upgrade your current version by doing:

```
portupgrade php5
portupgrade php5-extensions
```

I like to make backups of any related config. files first.
Once that's done, you will also want to do:


```
cd usr/ports/databases/php5-pdo_mysql
make install distclean
```

If you don't have portupgrade, do this before the others:


```
cd /usr/ports/ports-mgmt/portupgrade
make install distclean
```

Hope this helps!


----------



## arie01 (Aug 8, 2012)

Hi ph0enix, 

When I do *portupgrade php5*, I get command not found.
I did *cd /usr/ports/ports-mgmt/portupgrade* and *make install distclean* but what did it give me?

Thank you,


----------



## da1 (Aug 8, 2012)

Check this out .


----------



## SirDice (Aug 8, 2012)

rehash


----------



## arie01 (Aug 8, 2012)

SirDice, 

rehash worked! But what next?


----------



## OH (Aug 9, 2012)

Using portupgrade won't help you because the latest version of lang/php52 is still php 5.2 and you really shouldn't be using that (don't ask why then it's still in ports, that discussion can be found with some more searching).

perform [cmd=]pkg_delete -xi php52[/cmd] and then install either databases/php53-pdo_mysql or databases/php5-pdo_mysql (version 5.4). It will pull the right php version in automatically.

Unless you know for a fact that lilac supports 5.4, go for 5.3.


----------



## arie01 (Aug 9, 2012)

Hi Oh, 

I installed php53 then did what you suggested, selecting databases/php53-pdo_mysql and it installed successfully this time. 

But now, my php test page doesn't work.  

I have test.php in the /usr/local/www/apache22/data/ directory and the string

```
<? phpinfo(); ?>
```
 in it. 

When I open a browser and got to http://myhosy/test.php I get a blank page.

What could have happened? 

Ohhhh, this is so frustrating!!!!!!!!!!


----------



## OH (Aug 9, 2012)

You can check the file error_log for any errors.
You can check the source of the page in your browser and if it turns out the code is there unparsed, short open tags are likely disabled. 

So you have to write:

```
<?php phpinfo(); ?>
```


----------



## arie01 (Aug 10, 2012)

Hi Oh, 

when I look at the source of the web page, I see the code.
What is short open tags and how do I enable it?

Thank you,


----------



## SirDice (Aug 10, 2012)

If you can see the code it means PHP isn't enabled on Apache.

Make sure you have made these changes:

```
***************************************************************

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

***************************************************************
```


----------



## arie01 (Aug 10, 2012)

Ok, it worked! I pasted your code in the test.php file and it worked.

Thank you so much,


----------

