记录php安装

1 篇文章 0 订阅
#安装apache2.0
    sudo apt-get install apache2
    #重启命令:sudo /etc/init.d/apache2 restart

#安装php
    1.sudo apt-get install php7.0 libapache2-mod-php7.0
    #2.重启apache:
        sudo /etc/init.d/apache2 restart
    #3.在网站更目录创建info.php文件:
        sudo vim /var/www/html/info.php
    #4.访问测试

#列出PHP支持的所有模块
    sudo apt-cache search php7.0
    #安装所有:
        sudo apt-get install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php7.0-zip php-ssh2
    #重启apache:
        sudo /etc/init.d/apache2 restart

#安装php缓存:php-apcu(不是必须)
    #1.安装:
        sudo apt-get install php-apcu
    #2.重启apache:
        sudo /etc/init.d/apache2 restart

#配置Apache允许.htaccess和重写
    #1.编辑Apache配置文件:
        sudo vim /etc/apache2/apache2.conf
    #2.添加一个文档根目录配置;把Directory块中的AllowOverride的值设置为All
        <Directory /var/www/html/>
            AllowOverride All
        </Directory>
    #3.启动Rewrite模块
        sudo a2enmod rewrite
    #4.检测我们添加的配置有没有语法错误
        sudo apache2ctl configtest
    #5.重启Apache
        sudo /etc/init.d/apache2 restart
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值