Windows伺服器Azure雲編譯安裝MariaDB教程

來源:互聯網
上載者:User
試用1元Windows Azure,頻寬都是杠杠的。下面示範下Windows Azure下編譯安裝LNMP環境,系統內容是Ubuntu 14.04 TLS版
軟體版本:
資料庫:mariadb-10.0.13 StablePHP:php-5.5.15 StableNginx:nginx/1.4.6 (Ubuntu)(這裡Nginx採用Ubuntu的apt安裝方式)
1.建立MySQL使用者:
考慮到系統安裝,建立的使用者不能登入(nologin),編輯 vi /etc/shells 添加 “/usr/sbin/nologin”使系統支援建立nologin使用者
useradd -m /app/mysql -s /usr/sbin/nologin -u 555 mysql
2.安裝編譯環境和安裝MariaDB已經PHP依賴包:
apt-get install build-essentialapt-get install libncurses5-dev cmake bison libxml2 libxml2-dev libxslt1-dev libcurl4-openssl-dev libbz2-dev libpcre3 libpcre3-dev unzip openssl libssl-dev libpng12-dev libfreetype6-dev libjpeg-dev libmcrypt-dev libldap2-dev libsasl2-dev libboost-dev
3.下載並編譯安裝MariaDB、PHP
wget http://cn2.php.net/get/php-5.5.15.tar.bz2/from/this/mirror
wget http://mirrors.neusoft.edu.cn/mariadb/mariadb-10.0.13/source/mariadb-10.0.13.tar.gz
1).安裝目錄分別為:/app/mysql 和 /app/php5
2).cmake . -DCMAKE_INSTALL_PREFIX=/app/mysql/ -DMYSQL_DATADIR=/app/mysql/data/ -DSYSCONFDIR=/app/mysql/etc/ -DMYSQL_UNIX_ADDR=/app/mysql/tmp/mysqld.sock -DMYSQL_TCP_PORT=3336 -DWITH_SSL=system -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_ZLIB=system -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql
3)../configure --prefix=/app/php5 --with-config-file-path=/app/php5/etc/ --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/app/mysql/tmp/mysqld.sock --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-opcache
Ubuntu14.04 編譯安裝新版本的PHP5.5可能會出現如下錯誤:
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup@@OPENLDAP_2.4_2'//usr/lib/x86_64-linux-gnu/liblber-2.4.so.2: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusmake: *** [sapi/cli/php] Error 1
遇到這種類似的情況,說明「./configure 」?]抓好一些環境變數值。解決方案,來自老外的一篇文章:
在PHP源碼目錄下 vi Makefile 找到 EXTRA_LIBS 行,在行末添加 ‘ -llber ‘ 儲存退出再次make即可。
到此 Ubuntu編譯安裝MariaDB就完成了,關於Nginx串連PHP這裡就不多說了,下面是此次編譯的結果:http://azure0.iloxp.com/tz.php 這隻是測試用的,截圖留著哈:
不得不再說下,在編譯安裝PHP5.4以後版本的時候最好使用內建的Opcache緩衝功能,因為這個內建的緩衝真的很不錯,Hit很高,效能也很好。贊一個:
各種雲平台就這麼頻繁地進入我們的世界哈。
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.