Testing PHP and MySQL

Testing PHP and MySQL

am 17.01.2008 11:43:08 von Gaston Verhulst

Hello,
I'm working in FC8 and I like to use MySQL with PHP.
I have installed:
[gastonv@telenetPC ~]$ yum list installed | grep php
php.i386 5.2.4-3 installed
php-cli.i386 5.2.4-3 installed
php-common.i386 5.2.4-3 installed
[gastonv@telenetPC ~]$ yum list installed | grep mysql
mysql.i386 5.0.45-6.fc8 installed
mysql-libs.i386 5.0.45-6.fc8 installed
mysql-server.i386 5.0.45-6.fc8 installed

I can run separately PHP and MySQL, but not together.
For that, I have to do first:
[gastonv@telenetPC ~]$ sudo /etc/init.d/mysqld start
Starten van MySQL: [ OK ]
[gastonv@telenetPC ~]$ sudo /etc/init.d/httpd start
Starten van httpd:

And then I can start MySQL:
[gastonv@telenetPC Mysql]$ mysql -u gastonv -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.06 sec)

mysql> exit
Bye

To test working together, I have done 2 tests:

1. Testing PHP with test.php with the command phpinfo():
My working directory:
[gastonv@telenetPC public_html]$ ls mysql_up.php
mysql_up.php
[gastonv@telenetPC ~]$ firefox http://localhost/~gastonv/test.php
It shows a table with PHP Information:
PHP Version 5.2.4
....
Here, I have to see a Section for MySQL, indicating that MySQL support
is On.
But I don't see that section.

2. Testing MySQL with a well known program called mysql_up.php.
My working directorie for MySQL:

[gastonv@telenetPC public_html]$ firefox
http://localhost/~gastonv/mysql_up.php
The result should be a table with a long list of variable names and values.
And I read, if no error or warning messages are displayed, MySQL is
working fine.
But Firefox opens a blanco empty white window with the correct title,
and doesn't show any error message.

Please, is this correct, or do I have to configure more?

Thanks in advance for helping tips,
Gaston Verhulst.

Re: Testing PHP and MySQL

am 17.01.2008 18:32:09 von Shion

Gaston Verhulst wrote:
> Hello,
> I'm working in FC8 and I like to use MySQL with PHP.
> I have installed:
> [gastonv@telenetPC ~]$ yum list installed | grep php
> php.i386 5.2.4-3 installed
> php-cli.i386 5.2.4-3 installed
> php-common.i386 5.2.4-3 installed
> [gastonv@telenetPC ~]$ yum list installed | grep mysql
> mysql.i386 5.0.45-6.fc8 installed
> mysql-libs.i386 5.0.45-6.fc8 installed
> mysql-server.i386 5.0.45-6.fc8 installed

Run

yum install php-mysql

then

/etc/init.d/httpd restart


Thats all.


--

//Aho

Re: Testing PHP and MySQL

am 17.01.2008 19:26:20 von Gaston Verhulst

J.O. Aho schreef:
> Gaston Verhulst wrote:
>> Hello,
>> I'm working in FC8 and I like to use MySQL with PHP.
>> I have installed:
>> [gastonv@telenetPC ~]$ yum list installed | grep php
>> php.i386 5.2.4-3 installed
>> php-cli.i386 5.2.4-3 installed
>> php-common.i386 5.2.4-3 installed
>> [gastonv@telenetPC ~]$ yum list installed | grep mysql
>> mysql.i386 5.0.45-6.fc8 installed
>> mysql-libs.i386 5.0.45-6.fc8 installed
>> mysql-server.i386 5.0.45-6.fc8 installed
>
> Run
>
> yum install php-mysql
>
> then
>
> /etc/init.d/httpd restart
>
>
> Thats all.
>
>
I have to thank you very much for the beautiful tip!
[gastonv@telenetPC ~]$ yum list installed | grep php
php.i386 5.2.4-3 installed
php-cli.i386 5.2.4-3 installed
php-common.i386 5.2.4-3 installed
php-mysql.i386 5.2.4-3 installed
php-pdo.i386 5.2.4-3 installed
After that and a reboot, the result of the 2 tests is succesfull.
Now I can experiment more ...
Greetings,
Gaston Verhulst.

Re: Testing PHP and MySQL

am 17.01.2008 19:37:10 von Shion

Gaston Verhulst wrote:

> I have to thank you very much for the beautiful tip!
> [gastonv@telenetPC ~]$ yum list installed | grep php
> php.i386 5.2.4-3 installed
> php-cli.i386 5.2.4-3 installed
> php-common.i386 5.2.4-3 installed
> php-mysql.i386 5.2.4-3 installed
> php-pdo.i386 5.2.4-3 installed
> After that and a reboot, the result of the 2 tests is succesfull.

You know you are using Linux? So no point in rebooting, that is only needed if
you switch to a new version of the kernel, all you needed to do was to restart
the apache server with the simple

/etc/init.d/httpd restart

Thats all you need to do if you change settings in your php.ini or your in one
of the apache config files.


> Now I can experiment more ...

Good luck.
If you will be working with images, I suggest you use imagick (imagemagick)
instead, this will of course require that you first install imagemagick and
pecl and then use pecl to install imagick extension for php, it's a lot better
IMHO than gd.

--

//Aho

Re: Testing PHP and MySQL

am 17.01.2008 20:08:09 von Gaston Verhulst

J.O. Aho schreef:

>> After that and a reboot, the result of the 2 tests is succesfull.
>
> You know you are using Linux? So no point in rebooting, that is only needed if
> you switch to a new version of the kernel, all you needed to do was to restart
> the apache server with the simple
>
> /etc/init.d/httpd restart
>
> Thats all you need to do if you change settings in your php.ini or your in one
> of the apache config files.
>

Thanks too for remembering to this tip, it's easier of course, I was
forgotten it.

Please, was the following text intendet for me?

> If you will be working with images, I suggest you use imagick (imagemagick)
> instead, this will of course require that you first install imagemagick and
> pecl and then use pecl to install imagick extension for php, it's a lot better
> IMHO than gd.
>

Re: Testing PHP and MySQL

am 17.01.2008 21:33:00 von Shion

Gaston Verhulst wrote:

> Please, was the following text intendet for me?
>
>> If you will be working with images, I suggest you use imagick
>> (imagemagick)
>> instead, this will of course require that you first install
>> imagemagick and
>> pecl and then use pecl to install imagick extension for php, it's a
>> lot better
>> IMHO than gd.

For you and everybody else reading.

--

//Aho