熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> MySQL >> 正文

OPENBSD-3.8上快速部署apache+mysql+php+ssl[2]

2022-06-13   來源: MySQL 

    # chmod /etc/rcd/mysqldsh

    設置開機啟動MYSQL

    # vi /etc/rclocal

    if [ f /etc/mycnf ]; then
       /etc/rcd/mysqldsh start
    fi

     安裝配置PHP

    # pkg_add v phpcoreptgz

    運行下面的命令使其生效
    # cp /usr/local/share/examples/php/phpinirecommended /var/www/conf/phpini
    # /usr/local/sbin/phpxs s

    由於OPENBSD上的APACHE采用了CHROOT機制要保證PHP正常工作就要建下面的目錄PHP工作目錄

    # mkdir /var/www/tmp
    # chmod /var/www/tmp

    下面選擇安裝幾個PHP組件

    # pkg_add v phpgdpno_xtgz
    # /usr/local/sbin/phpxs a gd

    # pkg_add v phpmysqlptgz
    # /usr/local/sbin/phpxs a mysql

    # pkg_add v phpncursesptgz
    # /usr/local/sbin/phpxs a ncurses

    # pkg_add v phpimapptgz
    # /usr/local/sbin/phpxs a imap

    # pkg_add v phpcurlptgz
    # /usr/local/sbin/phpxs a curl

    # pkg_add v phpdbxptgz
    # /usr/local/sbin/phpxs a dbx

    # pkg_add v phpldapptgz
    # /usr/local/sbin/phpxs a ldap

    # pkg_add v phppdfptgz
    # /usr/local/sbin/phpxs a pdf

    # pkg_add v phpsnmpptgz
    # /usr/local/sbin/phpxs a snmp

    設置apache支持PHP:

    # vi /var/www/conf/httpdconf

    DirectoryIndex indexhtml indexphp
    AddType application/xhttpdphp php
    AddType application/xhttpdphpsource phps

    # vi /var/www/conf/phpini

    doc_root= /htdocs
    register_globals = On

    建立測試php頁面

    # vi /var/www/htdocs/testphp

    <?php phpinfo(); ?>

    測試一下

    # pkill httpd
    # /usr/sbin/httpd

    在浏覽器中輸入http://IP/testphp實驗一下

[]  []  []  


From:http://tw.wingwit.com/Article/program/MySQL/201311/29660.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.