參考網頁:http://twpeach.com/youtube-embeded/
<?php
// 讀入資料
$j=0;
$fd = fopen ("/絕對路徑/隨機相片.txt", "r");
while ($buffer = fgets ($fd, 4096))
{
$album[$j] = explode (",",$buffer);
$j++;
}
fclose($fd);
// 取亂數
$select=rand(1, count($album)-1);
$play=$album[$select][1];
2017年9月23日 星期六
隨機相片
<?php
// 讀入資料
$j=0;
$fd = fopen ("絕對路徑/隨機相片.txt", "r");
while ($buffer = fgets ($fd, 4096))
{
$album[$j] = explode (",",$buffer);
$j++;
}
fclose($fd);
// 取亂數
$select=rand(4, count($album)-1);
// 顯示相簿
echo $album[$select][1];
echo "<br><a href=http://jnespic.blogspot.tw/ target=_blank>".$album[$select][0]."</a>";
?>
// 讀入資料
$j=0;
$fd = fopen ("絕對路徑/隨機相片.txt", "r");
while ($buffer = fgets ($fd, 4096))
{
$album[$j] = explode (",",$buffer);
$j++;
}
fclose($fd);
// 取亂數
$select=rand(4, count($album)-1);
// 顯示相簿
echo $album[$select][1];
echo "<br><a href=http://jnespic.blogspot.tw/ target=_blank>".$album[$select][0]."</a>";
?>
2017年6月5日 星期一
PHP 重新安裝
不明原因個人網頁伺服器 PHP 不動了,PHP 程式碼直接被看到,重啟 Apache 也沒用,移除 PHP 後,重新安裝恢復正常。
# yum remove php
# yum install php
# systemctl restart httpd
# yum remove php
# yum install php
# systemctl restart httpd
2017年3月7日 星期二
CentOS 7.3 安裝 AMP
# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)
- 更新
- yum update
- 安裝常用工具 (非必要)
- yum install mlocate
- yum install wget
- yum install zip unzip
- yum install ntpdate
- 關閉 SELINUX
- vi /etc/sysconfig/selinux
將
SELINUX=enforcing
改為
SELINUX=disabled
重開機後生效 - setenforce 0
暫時關閉 SELINUX
2016年8月17日 星期三
2016年1月31日 星期日
CentOS 7 安裝 phpMyAdmin
CentOS Linux release 7.2.1511 (Core)
httpd-2.4.6-40.el7.centos.x86_64
mariadb-server-5.5.44-2.el7.centos.x86_64
php-5.4.16-36.el7_1.x86_64
httpd-2.4.6-40.el7.centos.x86_64
mariadb-server-5.5.44-2.el7.centos.x86_64
php-5.4.16-36.el7_1.x86_64
- 官網
https://www.phpmyadmin.net/ - 下載:從官網找到最新版本的鏈結
wget https://files.phpmyadmin.net/phpMyAdmin/4.4.15/phpMyAdmin-4.4.15-all-languages.zip
(安裝 wget:yum install zip wget) - 解壓縮
unzip phpMyAdmin-4.4.15-all-languages.zip
(安裝 zip 和 unzip:yum install zip unzip) - 移動解壓縮出來的資料夾到網頁目錄,並改名。
mv phpMyAdmin-4.4.15-all-languages /var/www/html/phpma
以上資料夾改名為 phpma,名稱自訂,自己記得就好。 - 開啟瀏覽器測試
http://y.y.y.y/phpma/
2012年7月13日 星期五
PHP 與 MySQL
系統:Centos6.2
Apache MySQL PHP 以 yum 安裝
/var/log/httpd/error_log 錯誤訊息
PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/includes/adodb/drivers/adodb-mysql.inc.php on line 353
安裝 php-mysql
# yum install php-mysql.x86_64
重啟 Apacche
# service httpd restart
可以用了
2011年12月28日 星期三
2011年9月18日 星期日
安裝 phpMyAdmin
下載
http://www.phpmyadmin.net/
解壓縮
tar zxvf phpMyAdmin-3.4.5-all-languages.tar.gz
複製到網頁目錄
cp -r phpMyAdmin-3.4.5-all-languages /var/www/html/phpMyAdmin
複製設定檔
cd /var/www/html/phpMyAdmin
cp config.sample.inc.php config.inc.php
編輯設定檔
vi config.inc.php
搜尋字串$cfg['Servers'][$i]['auth_type']。
將設定值由'cookie'變更為'http'。
訂閱:
文章 (Atom)