一般都是在config文件里面的,主要修改的是數(shù)據(jù)庫名、數(shù)據(jù)名、密碼,主機基本不用修改一般都為localhost

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:空間域名、網(wǎng)站空間、營銷軟件、網(wǎng)站建設(shè)、昆玉網(wǎng)站維護(hù)、網(wǎng)站推廣。
只能告訴你步驟,具體的還得靠你學(xué)習(xí)了。
執(zhí)行PHP代碼之前要安裝相應(yīng)的環(huán)境,就像劃船需要水一樣。現(xiàn)在一般都用wamp5
安裝好wamp5后,到開發(fā)目錄,新建一個index.php 文件,在這個文件里使用mysql_connect()函數(shù)連接數(shù)據(jù)庫,然后使用mysql_select_db選擇數(shù)據(jù)庫。這樣就可以操作這個數(shù)據(jù)庫了。
然后就是使用php代碼來增刪改查數(shù)據(jù)庫了。
你估計連菜鳥都算不上。。。你真要想學(xué)PHP的話,建議先看一下視頻,一目了然,通過文字說了也不好懂的。網(wǎng)上一搜一大堆,具體的不打了,百度可能把我的回答刪了。
如何用PHP作Linux自動執(zhí)行腳本? 在安裝PHP的時候,會產(chǎn)生一個可執(zhí)行文件,文件名為PHP.將它 copy 到 /usr/local/bin 下.在終端方式執(zhí)行PHP程序: PHP -q onlinnum.PHP PHP 原本是應(yīng)用在網(wǎng)頁應(yīng)用的﹐因此它會送出 HTML 的HEADER﹐但是在此我們是要將 PHP 用作 Shell Script﹐-q 就是表示不要送 出 HEADER 的意思.你可以試試看不加上 -q 的顯示結(jié)果。此時你已經(jīng)可以在終端方式下執(zhí)行PHP 代碼了。 linux命令:cron daemon 這是一個系統(tǒng)中常駐的服務(wù),功能在于執(zhí)行例行性的工作,如每天一次或每月一 次檢查磁盤。cron daemon 會在每分鐘檢查一次排定的工作表(crontab),看看是否有要執(zhí)行的指令,所有的輸出會以mail寄給用戶。 設(shè)置crontab 命令:crontab -e 該命令呼叫vi編輯器來編輯執(zhí)行的清單。例如 0 0 1,15 * * fsck /home 1 * * * * /home/myhome/printhello 每一行代表一項排定的工作,在指令前為排定的時間,總共有5個欄位,以空格間隔,由左到右依序如下: -------------------------- 分鐘 從00到 99 點鐘 從0到 24 日從01到31 月從01到12 星期 從01到07,代表星期一到星期日 *號表示每 ,如每天執(zhí)行,就在第三欄填*號 -------------------------- 所以上例的兩項工作是: 每月1號和15號檢查/home 磁盤 每小時的第一分執(zhí)行 /home/myhome/printhello 這個文件 查看crontab:crontab -l 刪除crontab:crontab -r 我們就知道該怎么利用PHP和crontab命令作Linux自動執(zhí)行腳本了。 還需要注意什么問題? 如果PHP中有使用數(shù)據(jù)庫,如oracle等,執(zhí)行腳本中還需export Oracle的環(huán)境設(shè)置。
當(dāng)然有,安裝是很方便的. 搜索LAMP自動安裝腳本,結(jié)果有很多.
#! /bin/bash
apache_prefix=/usr/local/apache
php_prefix=/usr/local/php
is_root=`id | awk '{print $1}' | awk -F '[=(]' '{print $2}'`
if [ `whoami` != "root" ] [ $is_root != 0 ]; then
echo "Please use root install this LAMP."
exit 1
fi
# check os
OS=`uname`
if [ "$OS" != "Linux" ]; then
echo "This is not linux os, Please use linux os. Thank you."
exit 2;
fi
# install apache
if [ ! -d "$apache_prefix" ]; then
tar zxvf httpd-2.2.19.tar.gz
cd httpd-2.2.19
./configure --prefix=$apache_prefix --enable-so --enable-rewrite --with-mpm=worker
make
make install
cd ..
if [ ! -f "$apache_prefix/htdocs/test.php" ]; then
echo "?php phpinfo(); ?" $apache_prefix/htdocs
fi
rm -rf httpd-2.2.19
echo "apache install is OK."
sleep 2
fi
# install mysql
is_install_mysql=`find /usr/local/bin -name mysql | wc -l`
if [ "$is_install_mysql" = 0 ]; then
tar zxvf mysql-5.5.3-m3.tar.gz
cd mysql-5.5.3-m3
./configure --without-server --with-extra-charsets=gbk,gb2312,utf8 --enable-thread-safe-client
make
make install
cd ..
echo "/usr/local/lib" /etc/ld.so.conf
ldconfig
rm -rf mysql-5.5.3-m3
echo "mysql intall is OK."
sleep 2
fi
# install freetype
if [ ! -d /usr/local/freetype ]; then
tar zxvf freetype-2.3.10.tar.gz
cd freetype-2.3.10
./configure --prefix=/usr/local/freetype
make
make install
cd ..
rm -rf freetype-2.3.10
echo "freetype install is OK."
sleep 2
fi
# install jpeg
if [ ! -d /usr/local/jpeg ]; then
tar zxvf jpegsrc.v8c.tar.gz
cd jpeg-8c
./configure --prefix=/usr/local/jpeg
make
make install
cd ..
rm -rf jpeg-8c
echo "jpeg install is OK."
sleep 2
fi
# install libpng
if [ ! -d /usr/local/libpng ]; then
tar zxvf libpng-1.2.41.tar.gz
cd libpng-1.2.41
./configure --prefix=/usr/local/libpng
make
make install
cd ..
rm -rf libpng-1.2.4
echo "libpng install is OK."
sleep 2
fi
if [ ! -f /usr/include/pngconf.h ]; then
ln -s /usr/local/libpng/include/pngconf.h /usr/include
fi
if [ ! -f /usr/include/png.h ]; then
ln -s /usr/local/libpng/include/png.h /usr/include
fi
# install gd2
if [ ! -d /usr/local/gd2 ]; then
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd2 --with-freetype-dir=/usr/local/freetype --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg
make
make install
cd ..
rm -rf gd-2.0.35
echo "gd2 intall is OK."
sleep 2
fi
# install php
if [ ! -d "$php_prefix" ]; then
tar zxvf php-5.2.13.tar.gz
cd php-5.2.13
./configure --prefix=$php_prefix \
--with-gd=/usr/local/gd2 \
--with-apxs2=$apache_prefix/bin/apxs \
--enable-mbregex \
--enable-bcmath \
--with-mysql \
--with-zlib-dir \
--enable-mbstring=all \
--with-pdo-mysql \
--with-freetype-dir=/usr/local/freetype
make
make install
cp php.ini-dist $php_prefix/lib/php.ini
cd ..
rm -rf php-5.2.13
echo "php install is OK."
sleep 2
fi
sed -f httpd.sed $apache_prefix/conf/httpd.conf $apache_prefix/conf/httpd.conf.tmp
cd $apache_prefix/conf
mv httpd.conf httpd.conf.bak
cat httpd.conf.tmp httpd.conf
$apache_prefix/bin/apachectl -t
cd
echo "LAMP install is OK."
文章題目:php安裝數(shù)據(jù)庫腳本 php的數(shù)據(jù)庫在哪個目錄下
分享URL:http://chinadenli.net/article30/dojicso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)、App開發(fā)、用戶體驗、網(wǎng)站設(shè)計、面包屑導(dǎo)航、網(wǎng)站設(shè)計公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)