Installing PHP 5.4.6

You need to issue these commands through the terminal

sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 libapache2-mod-php5

With this command restart the Apache 2.

sudo /etc/init.d/apache2 restart

You need to run this command to check if the installation process of PHP 5.4.6 is successful.

php5 -v

$  php5 -v
PHP 5.4.6-2~precise+1 (cli) (built: Aug 30 2012 14:38:34)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologie

Otherwise with this command create a PHP file.

echo “<?php phpinfo(); ?>” | sudo tee /var/www/test.php

Then you have to restart Apache2.

sudo /etc/init.d/apache2 restart

點閱: 47

By tony

自由軟體愛好者~喜歡不斷的思考各種問題,有新的事物都會想去學習嘗試 做實驗並熱衷研究 沒有所謂頂天的技術 只有謙虛及不斷的學習 精進專業,本站主要以分享系統及網路相關知識、資源而建立。 Github



這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料