联系站长! 傻子-跸西blog 傻子-跸西微blog
顶部

底部
Feed on
Posts
Comments

1.什么是dfgallery?
它是一个基于php+mysql的flash 相册,而且是 免费的。
下载地址
http://www.dezinerfolio.com/dfgaller…-flash-gallery

特点
* 自定义图片上传,可批量上传
* 可自定义主题和皮肤
* 支持全屏模式
* 集成Picasa和Flickr,可通过Flickr的API方式和Picasa的URL方式获取指定用户的相册,支持多用户相册展示,并且可以非常方便的进行切换。
* 更新通知功能
* 基于ajax的管理界面

2. 安装环境:一个纯净的CentOS 64bit VPS
php, apache和mysql是自己通过yum 装的

3.折腾过程
3.1 在vps的上直接下载zip的压缩文件,然后unzip之,
按照说明文档,修改如下两个文件的权限为777
“app/config/database.php” 和 “app/config/dfg/upgrade_state.php”

然后访问www.domain.com/dfgallery/ (我放在dfgallery文件夹下),然后提示错误:
Invalid JSON Error

好吧,这是为啥呢?google一番发现php-json在php5.2版本以后才作为标准扩展 er…..
那我就yum list php,发现默认yum安装的是php5.1.x
好吧继续google,找到一个方法:在/etc/yum.repos.d/CentOS-Base.repo 文件末尾添加以下代码:
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
保存以后,运行
yum –disablerepo=\* –enablerepo=c5-testing install php
输入Y同意安装, OK,然后装上了php5.2.10.

另外,页面还有其他错误,,resources文件夹一堆权限错误,无法写入。k,你丫就不能在文档里面写明也要改resources文件夹权限吗?
继续chmod 777 -R resources 修改权限

3.2 再次尝试安装,嗯?怎么还是有错?其实刚才就有这个错误。只不过没注意。
Invalid cURL response.
We expected ‘true’ from the url : http://xxxxxx/dfgallery/api/rest/test_curl
好吧,继续google,各种奇怪的方法都有,但是都行不通,
经过测试,直接在提示符下输入
http://xxxxxx/dfgallery/index.php/api/rest/test_curl
是通过的
那么好吧,估计就是程序自己的判断出了问题
直接修改install.php
查找
$curl_url = ‘http://’.$_SERVER[‘SERVER_NAME’].substr($_SERVER[‘SCRIPT_NAME’],0,strpos($_SERVER[‘SCRIPT_NAME’],’/index.php’)). ‘/api/rest/test_curl’;
修改为
$curl_url = ‘http://’.$_SERVER[‘SERVER_NAME’].substr($_SERVER[‘SCRIPT_NAME’],0,strpos($_SERVER[‘SCRIPT_NAME’],’/index.php’)). ‘/index.php/api/rest/test_curl’;

后来又发现一个方法,就是跳过这个检测(当然前提是你自己检测OK),我没有实际测试这个方法),修改install.php以下内容:
//if($clean_url_check_resp == ‘true’){
//$checks[] = array(‘Clean urls\’ have been enabled.’,true,”);
//}else{
//$checks[] = array(‘Invalid cURL response.’,false,”We expected ‘true’ from the url : $curl_url”);
//}
$checks[] = array(‘Clean urls\’ have been enabled.’,true,”);

3.3 再次尝试安装,Oh yeah~~~刚才错误页面没了………….等等….怎么又有新的错误?
Not Found

The requested URL /dfgallery/admin/setup was not found on this server.

我擦,继续google,然后发现大量和我同病相怜的人,解决方法也是五花八门,最后经过2天的反复尝试和搜索,终于找到我的解决办法(仅限于我自己的 vps,其他的我不知道是否有效,因为有些人可能装了drupal,但是我没有),其中艰苦就不提了,眼泪哗哗的…..
先修改 /etc/httpd/conf/httpd.conf
找到AllowOverride,修改<Directory>…</Directory>为如下内容,同时增加一段内容,更 改后内容如下(请记住/var/www/html/dfgallery/ 更改为你自己的dfgallery所在目录):

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<Directory /var/www/html/dfgallery/>
Options FollowSymLinks
AllowOverride All
</Directory>

然后在/dfgallery目录下增加.htaccess文件(555555 我也尝试了无数个文件),内容为
RewriteEngine On
RewriteBase /dfgallery
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]

3.4 继续安装,bingo!终于出现安装界面对话框了。输入域名,mysql类型选择mysql,还有mysql的用户名密码,可是,密码是啥来着……….?我拼命回忆几天前的密码,无果。擦! 我是root我直接改个新的不行么
mysqladmin -u root password ‘123456’
结果提示
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@’localhost’ (using password: NO)’
我咋这么命苦啊……..  ,试试重启mysqld服务,无果。继续google,
嗯 找到一个方法
# service mysql stop
# mysqld_safe –user=mysql –skip-grant-tables –skip-networking &

Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[5523]: started

# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

进去了 再设定一次密码..

mysql> UPDATE user SET Password=PASSWORD(‘123456′) where USER=’root’;
mysql> FLUSH PRIVILEGES;

mysql> \q

3.5 继续安装,又有提示
Unable to connect to the database with the given credentials, or the installed mysql Connector does not support authentication protocol.

检查一下,哦,难道域名一栏不能用域名?好吧我用localhost,oh yeah~~~~~终于安装完毕….,用默认admin/admin登录,修改密码。

3.6别忘了把app/config/database.php 权限改回644.

3.7点击<embed>,输入高度和宽度,点击generate code生成html代码,然后加到你的其他路径的页面代码中,就能显示相册了。

这几天把我折腾惨了,一些经验教训供大家分享。我这点技术可能linux老鸟会笑话,不过对于linux不熟练的人,还是有参考价值滴~~~~~

gallery.xml改起来很简单
tiltviewer 范例:
xml文件里面每段 <photo>..</photo> 之间的内容定义一个图片

gallery.xml改起来很简单
tiltviewer 范例:
xml文件里面每段 .. 之间的内容定义一个图片

//这行是指定文件所在位置,上例为tiltviewer所在目录的EXPO子目录下的DSCN0233.jpg文件,点击图片右下角箭头可以对图片进行翻转,翻转后点击左下角的时会跳转到linkurl的链接

Image 2

点击图片右下角箭头可以对图片进行翻转,上例翻转后显示的图片标题即为”Image 2 ”

bold, underline, italics, linebreaks
and font tags. Hyperlinks are not supported.]]>

点击图片右下角箭头可以对图片进行翻转,上例翻转后显示的图片说明即为“ This is a HTML text description. Supported tags are bold, underline, italics, linebreaks
and font tags. Hyperlinks are not supported.”


结束符

另外 index.html里面的关键几行:

fo.addVariable("maxJPGSize","640");

图片最大长度/宽度 (取其中的最大值),上例为640像素,如果设置偏小会导致预览图重叠

fo.addVariable("columns", "5");
fo.addVariable("rows", "5");

图片矩阵列数,行数,上例为5×5,文件超过25个就会自动分页

修改完毕,打开所在目录的index.html 文件就可以了
你还可以把它嵌入wordpress或者网站
方便简洁 无需mysql支持
缺点是不支持多个相册集成

有什么想法,说两句吧