站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
Gallery2:FAQ
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
=General Gallery2 FAQ= ==Does G2 work with Safe Mode PHP?== Gallery is NOT designed to work with safe mode. You can see the [http://gallery.menalto.com/node/3017 sticky thread] in the G2 development forum for an in depth discussion. Also see [http://gallery.menalto.com/node/21574 this topic] and [http://gallery.menalto.com/node/64888 this topic] for details of some experiments in getting G2 to work with safe mode. To sum it up, they are going to get G2 working first. If it works in safe mode, or can be modified easily to work in safe mode... they may. :'''What's PHP Safe Mode?''' From the official [PHP http://php.net/features.safe-mode Safe Mode documentation]: "The PHP safe mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now." : If you don't know what PHP is or how to turn Safe Mode off, you are probably not the person in charge of the webserver where you want to host a Gallery. Please contact your webhost / server administrator to resolve the problem. ==Why can't I upload big files (over a megabyte or two)?== The upload limits are enforced by the PHP / webserver configuration and not by Gallery 2. Craig Goranson wrote a very informative (but unfortunately Gallery 1 specific) [http://marc.theaimsgroup.com/?l=gallery-users&m=102589601604892&w=2 email] about how to fix this issue. Marcel Beemster updated it for Gallery2 at [http://marcelbeemster.com/answers/galleryuploadlimit/ his blog]. In short: The administrator can change the '''upload_max_filesize''' and '''post_max_size''' directives in php.ini (the PHP configuration file). Also, you can try to override the system-wide default settings in a .htaccess file. Example, add this to your .htaccess file in your gallery2/ folder to set a upload limit of 10 Mega Byte: php_value post_max_size 10M php_value upload_max_filesize 10M This can result in a "Internal Server Error" (error status 500) on all your Gallery pages. If you get an error after this change, remove your changes. That means that your webhost doesn't allow such changes in .htaccess. An alternative that works for some users: Add a php.ini file in your gallery2/ folder with the following contents (notice the difference, here we have a = and no php_value): post_max_size = 12M upload_max_filesize = 12M This may or may not work. You can check if these changes have actually changed your limits by browsing to your add items -> from browser page. Changing to bigger value "memory_limit =" might also help. Note though that the memory_limit does not have to be exceed the file size of the files that are uploaded. memory_limit plays a bigger role when using GD as your image toolkit module. More on that topic can be found in other FAQ entries. If you're using '''Apache 2''', especially with something like RedHat, you may need to edit another directive, '''LimitRequestBody''', as described in [http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=7419 this forum post]. Setting this directive to 0 (i.e. LimitRequestBody 0) will allow you to upload as big a file as you want (until you hit upload_max_filesize and/or post_max_size -- see the above email link for more information). [http://dreamhost.com Dreamhost] customers (and perhaps customers of other providers) should try searching for specific instructions on how to accomplish this. In the case of [http://dreamhost.com Dreamhost], they provide a wiki page describing exactly how to accomplish it [http://wiki.dreamhost.com/index.php/PHP.ini here]. I have personally tested it and it works. It boils down to creating a cgi-bin directory, copying their cgi php handler and setting it to be your default php handler. They also provide information on how to create a script that keeps php.ini and php.cgi up to date, but with your settings instead of theirs. Another option is to ftp to a folder on the local server and use the "Add Item" -> "From Local Server" option. You may need to rebuild the thumbnail for that item. This works on the 1and1 servers. ==PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes exhausted?== You are exhausting the available memory that PHP has access to. In php.ini there is a config variable named memory_limit that by default is set to 8MB. Edit '''php.ini''' and increase it to a larger value (restart Apache afterwards). If you don't have access to php.ini, you can add this line to your '''.htaccess''' file in your gallery2 folder. Usually, unless you are the owner of the server, you don't have access to change php.ini. If there is no .htaccess file yet, you can create one (it's just a text file with the name '.htaccess'). php_value memory_limit [new memory limit] To change it to 24 MB, write: php_value memory_limit 24M If the .htaccess method does not work or if you get an internal server error after adding this line, remove the line from the .htaccess again. You can also try to change the memory_limit by adding the following line right after '<?php ' in install/index.php and in main.php: ini_set("memory_limit","32M"); If there's no "memory_limit" parameter in your phpinfo page, then all PHP/Webserver processes are limited by the '''per process max memory limit'''. You'll have to ask an administrator to change the limit in this case. On linux/unix, you can check the limit with the following command in the shell: ulimit -a Or with PHP with a script check.php <?php print system('ulimit -a'); ?> ==Does gallery remote work with G2?== It would appear it does, point gallery remote at the base url of your gallery. For instance, I would point it to "http://my.gallery.domain/gallery2/" Note: Gallery Remote doesn't work with Gallery 2.2.1 - nor does iPhotoToGallery... yet ==Can I update from G1 -> G2?== Yes. The basic strategy is that you install and configure a copy of Gallery 2 right next to your copy of Gallery 1, then you use the [[Gallery:Gallery2:Modules:migrate |migration module]] to import all your Gallery 1 data (users, albums, photos, metadata) into your Gallery 2. This will make a complete copy of your data in Gallery 2 and then you're free to delete your Gallery 1 install. It will even give you mod_rewrite rules that can redirect all your old Gallery 1 urls to the correct places in Gallery 2. If you don't have enough free disk space to migrate it all at once, you can migrate a few albums at a time. Please refer to the [[Gallery:Gallery2:migration|detailed migration guide]] if you have any problems. ==Where can I find NetPBM, jhead or ImageMagick binaries to use with G2?== You can find links to NetPBM and jhead on the [http://codex.gallery2.org/Downloads Gallery Download Page]. You might also find Image Magick binaries [http://www.imagemagick.org/ here]. The ImageMagick binaries are installed on /usr/bin which is the default when you configure Gallery after the one-click install. ==Where can I find unzip / zip binaries to use with the zip cart module?== You can find them [http://www.info-zip.org/pub/infozip/Zip.html here] , but keep in mind this is a 3rd party site not under Gallery's control. ==I customized a *.tpl file, but then removed it... but the customization is still showing up. Did I do something wrong?== If you remove a local/*.tpl file it won't switch back to the *.tpl file due to smarty caching. You can get it to switch back to *.tpl by clearing the smarty cache manually on the filesystem, running the Flush Templates task in Site Admin/Maintenance, using Cache Maintenance found in the /lib/support/ page or by doing 'touch filename.tpl' which causes the last change time to update. ==How can I move my storage folder to another path?== Here's a step by step guide: # Before moving the directory, consider the [[Gallery:Gallery2:Security|security aspects]] and ensure that the new home for your Gallery data folder is outside the web-root. # Move the storage folder e.g. by using the move/rename feature of your ftp application, or a file browser in your webhost's admin panel or within the shell. # Verify that permissions on the directory and files inside are owned by the web server or writable (chmod 777) # Edit config.php manually. Update the line: $gallery->setConfig('data.gallery.base', 'some/path'); (Replace 'some/path' with the correct value.) Save config.php, and you're done. ==How can I move my gallery installation from one folder to another?== Here's a step by step guide: # Deactivate and uninstall the url rewrite module if it's active (not just disable the rewrite rules, disable and uninstall the whole module in ''site admin -> modules (plugins in later versions)''). # Move the gallery folder (move/rename it with an ftp application, a file browser or with a shell). If you choose to move gallery from a subdirectory to the root of your website, just move all files and directories that are in the gallery folder to the web root directory. # Edit config.php manually. If the g2data was within the gallery directory and you moved it, update the line: $gallery->setConfig('data.gallery.base', 'some/path'); If you use a multisite install, you also have to update: $gallery->setConfig('galleryBaseUrl', ''); Save config.php, and you're done. If you are using XCache or another php accelerator, you may need to clear your accelerator cache before the new settings will take effect. Old installation paths may still be present until they are cleared. ==How can I move my gallery installation from one server to another?== Here's a step by step guide: # [[Gallery:Gallery2:How do I Make Backups of My Database|Backup your installation]]! # Upgrade G2 on the old server to the same G2 version which you plan to install on the new server. # Deactivate AND uninstall the url rewrite module if it is active because it will generate incorrect urls after your move. # Backup G2 on your old host. Backup the database ''and'' the g2data folder. # Copy the g2data folder and import the mysql database to your new host. You can skip copying the g2data/locks directory if you want. # If you're using MySQL and moving from a windows based server to a *nix (unix, linux, ...) based server, you will have to change each database table name from lower case (e.g. g2_albumitem) to a case-sensitive name (in this example g2_AlbumItem). See script [[Gallery:Image:CaseSensitiveTables.zip]] to automate this process a bit. # Install the gallery2 code (extract gallery2.tar.gz/zip) on the new host. It should be the same G2 version as you last used on the old host (that's why you did the upgrade in step 2.). # Have your webhosting partner change the owner of the g2data dir recursively (all files and folders) to the webserver user, unless php cgi + suexec is used. If you don't understand this instruction, forward it directly to your webhosting partner. The webhost has to do this only once, I'm sure they will do it. If they don't then make sure that the webserver user can write and delete files in this directory (chmod 777). # Don't copy the config.php from the old host to the new host unless you're willing to hand edit it. It's easier to just run the installer; browse to newhost/gallery/install/. Make sure you choose "reuse existing database tables" in the database step. Point the installer in the appropriate step to the g2data folder (which is now not empty). And finish the installer. If you choose to copy the config.php instead of running the installer you have to manually change: #* the g2data path #* galleryId (at the bottom of config.php) #* db name/user if needed # Go to G2 Site Admin and change all paths if needed. imagemagick, zip, netpbm, ... all modules that depend on external programs have to be tested and reconfigured. Make also sure that the mail function of G2 works on the new host. ==How can I export data from one G2 to another G2 installation?== Unfortunately, there's no tool to export/import data from one G2 installation (source) to another (target). But there are a few methods that may solve your problem. * If there's no G2 installation yet on the target server, just copy your existing G2 installation to the target server. See the FAQ entry about moving a G2 installation from one server to another. * If the target G2 installation is empty or doesn't have much data yet, we'd recommend removing the target G2 installation completely, then copying the source G2 installation to the target server and then add your previous albums again, manually or with the recursive "From Local Server" method. * If both G2 installations are already populated with a lot of data, you can import albums/photos files only. Descriptions, keywords, user data, ... are lost, but it imports all albums with all items in the correct structure. You can also decide to only import selected albums and you can specify the target parent album: Copy the g2data/albums/ directory of the source G2 installtion to a directory somewhere on the server of the target G2 (but not into the g2data/ directory). In your target G2, go to "Site Admin" -> "Web/Server" and add the directory /path/to/source/g2data/albums/ as a local server upload path. Of course your path is different from this example path. Then go to back to the top album of your target G2 and click "add item" -> "From Local Server" and select the path you just entered in site admin. Select the albums you'd like to import and start the process. It will add all albums / photos recursively, that is, it adds them including all sub-albums etc. Once the process is finished, you can remove the /path/to/source/g2data.albums/ folder from the target server. ==Why does the random image or random highlight not obey permissions? How come some of my images in private albums are shown?== Permissions are handled on an item by item basis, not an album by album basis. Just because "album01" is private, doesn't mean that "album01/album02/image3" is also private. This is by design and intentional, BUT the problem is in the interface which does not mention or explain this in any way. Someday the permissions UI will be improved. ==I use NFS and Gallery isn't working, is there a solution?== By default Gallery 2 uses flock for locking and this is known not to work over NFS. Go to Site Admin / General and switch to database locking instead. ==Is it my imagination, or is G2 slower than G1?== You're probably not imagining it. There are three main areas where Gallery 2 is going to be slower. Gallery 2 uses a database for its storage. This means that even the most trivial operations require communication with the database to get answers. In comparison, Gallery 1 stores everything in fairly small flat files and it loads all the data into memory and then operates on it. For small Gallery installations on hardware that is 3+ years old, you're going to find that Gallery 1 runs a fair bit faster. However, Gallery 1 will not scale as effectively so as you start to get up to having 5-10K photos, you'll find that Gallery 2 is much more efficient. Having a database also allows other applications to interact with Gallery data, which is a big advantage over Gallery 1's proprietary data format. Gallery 2 provides complete image security. If you restrict a photo based on its permissions, no outsider can get to it. This is in contrast to Gallery 1 that merely creates urls to images that an outsider could browse to, if he or she knew the url. However, this security comes at a performance cost. We are considering different approaches, including the possibility of allowing you to lower or remove this security threshold to increase your performance. G2 is a '''much''' larger framework than G1. It's designed to be incredibly flexible and maintainable. This leads to having a lot more code and because of the nature of PHP, this causes pages to load a little slower. However, this also means that PHP accelerators like [http://eaccelerator.net/ eaccelerator], [http://www.php-accelerator.co.uk/ ionCube PHPA], [http://turck-mmcache.sourceforge.net/ Turcke MMCache], [http://pecl.php.net/package/APC Pear::APC], [http://trac.lighttpd.net/xcache XCache], and Zend Accelerator (commercial) can effect very substantial performance increases when properly used in conjunction with G2. We recommend this option, if it's available to you (i.e. if you have full control over the php installation on your server). [http://www.sitebuddy.com/PHP/Accelerators/eAccelerator_windows_binaries_builds eAccelerator Windows Downloads]. Performance is an important factor to us. We have introduced caches at strategic places and are working on ways to improve all of the issues above to increase performance. It is secondary to making a fully featured product for now, but as we get closer to the official release date it will gain higher priority for the development team. For further tips, be sure to check out [[Gallery:Gallery2:Performance_Tips|Gallery2 Performance Tips]]. '''Note''': There's a known bug in the 2.0 release where if you import a large number of albums from Gallery 1, it can fail to optimize the permissions table leading to really bad performance (2-3+ second response times for a page load). If that happens, you can fix it. Just change any permission anywhere in your G2. You may have to do this a couple of times because each time you change a permission it has a 50% chance of re-optimizing your permission table. If you want to check the before/after, you can run this query select count(*) from g2_AccessMap; Before and after the permission change. If the number of rows drops dramatically (like from 2000 rows down to 30) then you've fixed the problem. ==When I upload an image, G2 doesn't seem to create sized images or thumbnails... also, when I enter an album for the first time it takes a LONG time to load. What is the deal, yo?== G2 has some fundamental differences from G1. In G1, thumbs and sized images were created at image upload. In G2, these items are not created UNTIL they are accessed/needed. This means that the first time you view a sized image or album, it may take a while for the images to be generated. Of course, subsequent visits should be much faster because they already exist. I believe there are also plans for the ability to generate the needed images at upload or when ever the user wishes, independent of viewing them for the first time. Update: There is now a check box present during import and upload that allows for the generation of thumbs/sized images right then. Using this will increase the time it takes to upload/migrate, but will take care of it immediately instead of when a user first requests the image. ==I am having trouble configuring a graphics toolkit (ImageMagick, NetPBM or ffmpeg). Help?== First- when the configuration asks for the path it is not asking for the path to the gallery2 module (like gallery2/modules/imagemagick). These directories are G2's interfaces to these programs and not the programs themselves. You need to find or install the binaries on your system, make sure they are executable, and enter the appropriate path in the configuration. See: http://codex.gallery2.org/Installing_an_Image_Processing_Library ==Can I change the timezone for dates/times displayed in G2?== Add a line like this in config.php before the ?> at the end: putenv('TZ=PST8PDT'); Replace PST8PDT with the appropriate timezone string. For more information about appropriate timezone strings, see this [http://en.wikipedia.org/wiki/Zoneinfo Wikipedia entry on Zoneinfo]. For actual acceptable values, see [http://en.wikipedia.org/wiki/List_of_tz_zones_by_name this list on Wikipedia]. ==Can I rename main.php?== To use a different main php file '''after''' G2 is installed follow these steps: *Disable and uninstall the URL-rewrite module. *Copy or symlink main.php to the new filename. **If you want index.php just remove/delete index.php and rename main.php to index.php *Add a line like this in config.php before the ?> at the end: define('GALLERY_MAIN_PHP', 'filename.php'); As of 2.0-rc-2 you can also do define('GALLERY_MAIN_PHP', <nowiki>''</nowiki>); to set the default document to / hiding all reference to index.php or main.php. You'll also need to set baseUri, the now second-to-last line in config.php, to '/' (for example for a domain-level install of gallery). ==Can I install if my server only allows .php4 extension for php files?== If your system does not accept ".php" as an extension for PHP files and requires ".php4" then follow these steps: # Rename index.php, main.php, install/index.php and upgrade/index.php to end in php4 extension. # Browse to install/index.php4 and proceed with the install. Note the "Go to Gallery" link at the end of the install will not work. # After installation follow the steps in the FAQ entry above to change main.php to main.php4. # Optionally rename config.php to config.php4 and update end of bootstrap.inc to reference config.php4 (to protect config.php contents from being viewable via browser). # Now you should have a functioning G2. # To support upgrades, find this line in upgrade/index.php4: function generateUrl($uri, $print=true) { Just after that line add: $uri = str_replace('index.php', 'index.php4', $uri); And change upgrade/index.php to upgrade/index.php4 in main.php4. ==Why don't you support PHP 5.0.3?== PHP 5.x versions older than 5.0.4 have a very important bug (bug id [http://bugs.php.net/32290 32290]). This bug affects object oriented software like G2, and the libraries that G2 uses (Smarty, ADOdb). We know of at least two features that don't work because of this bug (advanced search, publishxp). There may be many other problems, including data integrity issues. Bottom line: PHP 5.0.3 has a grave bug. Gallery cannot reasonably work around it. Upgrading to PHP 5.0.4+ should resolve it. If you must stick with PHP 5.0.3 you can remove the PHP version check that prevents you from installing G2 by changing a few code lines in install/steps/SystemChecksStep.class and upgrade/steps/SystemChecksStep.class. You can also fix the advanced search and publishxp, it's described in [http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=158190&highlight=#158190 this forum topic]. ==How do I backup G2?== A full backup consists of your 'g2data' directory, database, /gallery/config.php and /gallery/.htaccess. NOTE: If you don't use the URL Rewrite module you won't have a .htaccess file. <br /> :*[[Gallery:Gallery2:How_do_I_Make_Backups_of_My_Database|How Do I Make Backups of My Database]] ==My Gallery URLs begin with /v/ and /d/, why?== Gallery needs these prefixes (/v/, /d/, ...) to detect different types of requests. /v/ for album and photo "view" pages, /d/ for download URLs, etc. You can change this prefix in Site Admin -> URL Rewrite. You can even remove the prefix for the view pages (/v/). However, you should be aware that if you remove the /v/ prefix, you may no longer have top level albums which have the same name as one of the directories in the Gallery directory. In other words, creating a top level album "lib", "themes", "modules", "install", .. is ok when you have a /v/ prefix, but it will result in problems when removing this prefix. There's a maintenance task to check that there's no conflict like this in your Gallery (Site Admin -> Maintenance). == How can I use Gallery 2 Images in other Websites? == You would like to show your Gallery 2 images in another website or forum (bulletin board) or you would like to add a link on another website to a specific image / album of your Gallery 2. * For image links, right-click with your mouse on the image in Gallery 2 and copy the image address (most browsers offer this feature) * For links to a specific album / item in your Gallery 2, browse to the album / item and copy the address that is in the address bar of your browser (remove the g2_GALLERYSID= stuff, if there is any) * If you are wondering why the links look like main.php?g2_view=core.ShowItem&g2_itemId=35 for item links and main.php?g2_view=core.DownloadItem&g2_itemId=35 for image links: These links may look a little weird, especially the DownloadItem link since you'd expect that a image URL looks rather like album/image.jpg, but it is actually a image link. If you want nicer links that look more ''normal'', e.g. image links that end with .jpg, then activate the Gallery 2 URL rewrite module. You can do that by logging into Gallery2 with the administrator account, then click ''site admin'', then ''Plugins''. At the top of the list you should see URL Rewrite, and on the right of that line, click on ''activate''. Follow the on-line instructions from there. When you're successful, a green tick appears next to the plugin name. * There is a module that prepares image and item links for you such that you don't have to right-click etc. See: [[Gallery:Gallery2:Modules:geturls|Preformatted URLs Module]] == How do I get updated items to show first in an album (like new items do) ==
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)