VBoxManage + php5

1.設置網絡配置
cf @cf :~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.10.131
netmask 255.255.255.0
cf @cf :~$


sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

sudo gedit /etc/apt/sources.list   or   sudo vi /etc/apt/sources.list

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

sudo apt-get update  #會訪問源列表裏的每一個網址,並讀取軟件列表,而後保存在本地電腦。
sudo apt-get upgrade  #會把本地已安裝的軟件,與剛下載的軟件列表裏對應軟件進行對比,若是發現已安裝的軟件版本過低,就會提示你更新。

192.168.10.131
VBoxManage.exe clonevdi D:\Ken\vm\cf.vdi D:\Ken\vm\linux.vdi
192.168.10.132
VBoxManage.exe clonevdi D:\Ken\vm\cf.vdi D:\Ken\vm\ldap.vdi
192.168.10.133
VBoxManage.exe clonevdi D:\Ken\vm\cf.vdi D:\Ken\vm\java.vdi

執行完命令後會在VirtualBox的指定目錄下生成一個新的vdi文件,新建一個虛擬機使用該虛擬磁盤就能夠實現虛擬機的克隆。 php


sudp apt-get install php5
php5 -v
cat /etc/apache2/mods-enabled/php5.load
sudp apt-get install mysql-server
sudo apt-get install php5-mysql

or
sudo apt-get install apache2 php5 mysql-server php5-mysql
or
sudo tasksel install lamp-server

sudo service mysql restart
sudo service apache2 restart html


php
sudo apt-get install apache2
sudo apt-get install php5
php5 -v
cat /etc/apache2/mods-enabled/php5.load

sudo apt-get install mysql-server
cat /etc/php5/conf.d/mysql.ini  無

sudo service mysql restart
sudo service apache2 restart

cd /var/www
sudo vi info.php

sudo apt-get install libapache2-mod-php5
sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode
php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

下面是擴展包安裝。
sudo apt-get install  php5-gd curl php5-curl libcurl3 libcurl3-dev
擴展包安裝後

    找到本身要安裝的模塊名字,按以下格式輸入命令 ----下面
    sudo apt-get install php5-mysql php5-curl php5-gd

    下面是解釋,不是命令
    apt-get install php5-cgi
    apt-get install php5-fpm
    apt-get install php5-curl  (客戶端 URL 庫函數庫)
    apt-get install php5-gd (GD庫圖像函數庫)
    apt-get install php5-mysql  (增長對mysql支持)
    apt-get install php5-mcrypt  (Mcrypt 加密函數庫)
    apt-get install php5-memcache  (Memcache客戶端)
    apt-get install php5-memcached  (Memcache服務端)
    apt-get install php5-dev    (開發支持模塊)
sudo apt-get install phpmyadmin
sudo ln -s /usr/share/phpmyadmin/ /var/www/html/

cat /etc/php5/conf.d/mysql.ini  這個是10.04 下有
cat /etc/php5/mods-available/mysql.ini    這個有  14.10版


options類相關項a
MYSQLI_OPT_CONNECT_TIMEOUT    鏈接超時 (supported on Windows with TCP/IP since PHP 5.3.1)    
MYSQLI_OPT_LOCAL_INFILE       啓用/禁用 加載本地二進制文件
MYSQLI_INIT_COMMAND           鏈接服務器後,須要執行的命令
MYSQLI_READ_DEFAULT_FILE      從命名選項文件讀取選項    
MYSQLI_READ_DEFAULT_GROUP     讀取指定且的選項文件.    
MYSQLI_SERVER_PUBLIC_KEY      RSA基於公鑰文件與sha-256一塊兒使用的身份驗證


<?php
header("Content-type:text/html;charset=utf-8");
echo '開始mysql數據庫鏈接.<br>';
$con = mysql_connect("localhost","root","hx123");
if($con){
    echo '鏈接mysql數據庫成功.<br>';
}else{
    die('鏈接mysql數據庫失敗:' . mysql_error());
}
mysql_close($con);
echo '關閉mysql數據庫鏈接.';
?>
 
$link=mysql_connect("localhost","root","hx123");
if(!$link) echo "沒有鏈接成功!";
else echo "鏈接成功!"; java

相關文章
相關標籤/搜索