Top Nav

Archive | Scripting

Upgrade CentOS5 to PHP 5.2.x

Add c5-testing repository to yum:

You can then view the latest available php packages with:

Then you can install them with:

1

Hide PHP Version

To hide the PHP version from HTTP responses, edit /etc/php.ini and change:

to:

Then restart apache.

0

PHP Mailer : Swift Mailer

Every time I need a PHP class to handle sending email I turn to Swift Mailer at:

http://swiftmailer.org.

It’s feature rich and easy to use.

Only downside is it doesn’t work for PHP4.

0

Alternate Install Method For PHP PECL Modules

If the traditional “pecl install APC” style command is not working for some reason, here is the manual procedure:

0

Determine PHP Version

How can I determine what version of PHP is running on my server?

If you have command line access to the server then type:

or

And you’ll get a result similar to this:

Be careful using this approach. It is possible that there is more then one install of PHP on your server and the webserver may be using an install that is not in your command line path.

Use the whereis command to check for multiple installs like this:

Notice the second install at /usr/local/bin/php. If we check the version of the second install we might get different.

Another way to determine the version is to create a test page on the webserver.

Place the following line in the file:

Call the file “test.php”. Next with a web browser access the file with:

http://www.myserver.com/test.php

You’ll get back an extensive report on the configuration of the PHP install on the server. The PHP version will be shown in the title at the top of the report.

Make sure you remove the test.php file after you are finished with it. The file contains information that could assist hackers so you don’t want to leave it sitting around.

3