首页 > php教程 > php手册 > 正文

How to install/setup latest version of PHP 5.5 on

php中文网
发布: 2016-06-06 20:13:04
原创
1279人浏览过

Please note: This works fine. But this package will also upgrade your apache to version 2.4 which has different config files than apache 2.2 and even deletes stuff, like?/etc/apache2/sites-available/defaultwhen upgrading. This may result i

please note: this works fine. but this package will also upgrade your apache to version 2.4 which has different config files than apache 2.2 and even deletes stuff, like?/etc/apache2/sites-available/defaultwhen upgrading. this may result in a loss of your apache settings (vhost, mod_rewrite stuff etc.). be aware of that ! this shit cost me a full weekend. this affects only upgrades, not fresh installs for sure.?update:?this is a known bug (more here), i’ll keep this post updated…

How to install

There’s an excellent and (usually) hassle-free method to install the latest version of PHP5 (which is 5.5.3 when i’m writing this) with 3 simple bash commands:

1. Add this package-repository to your system. If Ubuntu says that you need to download a key first, then follow the instructions given in the notice.

sudo add-apt-repository ppa:ondrej/php5
登录后复制

If you get an error message now, then please do an update first and install the python-software-properties, that need to be necessary to add a package repository:

sudo apt-get update
sudo apt-get install python-software-properties
登录后复制

2. Update

立即学习PHP免费学习笔记(深入)”;

sudo apt-get update
登录后复制

3. Install PHP

sudo apt-get install php5
登录后复制
更新过程中可能会出现The package openfire needs to be reinstalled, but I can't find an archive for it的错误。
登录后复制
使用命令将openfire卸载掉:?dpkg --remove --force-remove-reinstreq openfire
登录后复制

Check the installed version of PHP via

FlowMuse AI
FlowMuse AI

节点式AI视觉创作引擎

FlowMuse AI 85
查看详情 FlowMuse AI
php5 -v
登录后复制

Please note: The ondrej/php5 repository (which is used here) provides the very latest version of PHP. Usually the new version of PHP is available a few days after it was been officially released. This is really cool and a big step forward as Ubuntu, Debian, CentOS etc. provide only very old versions by default.

To UPDATE from PHP 5.3 / 5.4 to PHP 5.5:

It’s also possible to update from any PHP version to the latest one with exactly the commands above. But, after doing

sudo apt-get install php5
登录后复制

you’ll have to restart the server with

sudo /etc/init.d/apache2 restart
登录后复制

or

sudo service apache2 restart
登录后复制

By the way, I’ve also written a tutorial on “How to setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2 (and how to fix the GPG key error)“, which is different from this here.

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号