• ADADADADAD

    Linux中PHP的源码安装shell脚本[ mysql数据库 ]

    mysql数据库 时间:2024-12-25 09:56:52

    作者:文/会员上传

    简介:

    #!/bin/bash#安装PHPrpm -e php php-cli php-ldap php-common php-mysql --nodepsyum -y install zlib-devel libxml2-develtar zxf /libmcrypt -C /usr/srccd /usr/src/lib

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    #!/bin/bash
    #安装PHP
    rpm -e php php-cli php-ldap php-common php-mysql --nodeps
    yum -y install zlib-devel libxml2-devel
    tar zxf /libmcrypt -C /usr/src
    cd /usr/src/libmcrypt

    ./configure
    make && make install
    ln -s /usr/local/lib/libmcrypt. /usr/lib
    cd
    tar zxf /mhash-
    -C /usr/src
    cd /usr/src/mhash-
    ./configure
    make && make install
    ln -s /usr/local/lib/libmhash
    /usr/lib
    cd
    tar zxf /mcrypt- -C /usr/src
    cd /usr/src/mcrypt-

    export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
    ./configure
    make && make install
    cd
    tar zxf /php- -C /usr/src
    cd /usr/src/php-

    ./configure --prefix=/usr/local/php5 --with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php5 --enable-mbstring
    make && make install
    cp /usr/src/php-/php.ini-development /usr/local/php5/php.ini
    sed -i '680c default_charset ="utf-8"' /usr/local/php5/php.ini
    sed -i 's/short_open_tag = Off/short_open_tag = On/' /usr/local/php5/php.ini
    sed -i '873c extension=php_mysqli.dll' /usr/local/php5/php.ini
    tar zxf /zend-loader-php
    -C /usr/src
    cd /usr/src/zend-loader-php
    cp ZendGuardLoader.so /usr/local/php5/lib/php
    sed -i '340a zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.so' /usr/local/php5/php.ini
    sed -i '341a zend_loader.enable=1' /usr/local/php5/php.ini
    sed -i '259c DirectoryIndexindex.html index.php' /usr/local/httpd/conf/httpd.conf
    sed -i '396a AddType application/x-httpd-php.php' /usr/local/httpd/conf/httpd.conf
    /usr/local/httpd/bin/apachectl restart
    echo "<?php" > /usr/local/httpd/htdocs/test1.php
    echo "phpinfo();" >> /usr/local/httpd/htdocs/test1.php
    echo "?>" >> /usr/local/httpd/htdocs/test1.php
    echo "<?php" > /usr/local/httpd/htdocs/test2.php
    echo "\$link=mysqli_connect('localhost','root','');" >> /usr/local/httpd/htdocs/test2.php
    echo 'if($link) echo "good";' >> /usr/local/httpd/htdocs/test2.php
    echo 'mysqli_close($link);' >> /usr/local/httpd/htdocs/test2.php
    echo "?>" >> /usr/local/httpd/htdocs/test2.php
    tar zxf /phpMyAdmin-
    -C/usr/src
    cd /usr/src
    mv phpMyAdmin-* /usr/local/httpd/htdocs/phpMyAdmin
    cd /usr/local/httpd/htdocs/phpMyAdmin
    cp config.sample.inc.php config.inc.php

    Linux中PHP的源码安装shell脚本.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: mysqlphphe