我有一台运行 nginx 1.0.15、PHP (FPM/FastCGI) 5.5.8 和 MySQL 5.5.35 的 CentOS 6.5 x64 服务器。
我已经安装了 phpMyAdmin 4.1.5 并配置了一个 nginx 虚拟主机,其中 html_root 链接到 phpMyAdmin 目录的符号链接(symbolic link)。
我的问题是,当我打开地址 (https://172.28.65.80:8060) 时,我从 phpMyAdmin 收到了这个错误:
Fatal error: Call to undefined function __() in /usr/share/phpMyAdmin/libraries/core.lib.php on line 229
我做错了什么?
编辑:
如果我尝试使用 php(不是 php-fpm)从控制台运行 phpMyAdmin,它会显示:
# php /usr/share/phpMyAdmin/index.php
Warning: require(./libraries/Error_Handler.class.php): failed to open stream: No such file or directory in /usr/share/phpMyAdmin/libraries/common.inc.php on line 57
Fatal error: require(): Failed opening required './libraries/Error_Handler.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/phpMyAdmin/libraries/common.inc.php on line 57
显然 Error_Handler.class.php 正确存储在 /usr/share/phpMyAdmin/libraries/
编辑2:
这是 phpMyAdmin 使用的虚拟主机的配置:
#
# HTTPS phpmyadmin virtual host configuration
#
server {
listen 8060;
server_name 172.28.65.80;
ssl on;
ssl_certificate /root/rootCA.pem;
ssl_certificate_key /root/rootCA.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location / {
root /usr/share/phpMyAdmin;
index index.php;
}
location ~ \.php$ {
root /usr/share/phpMyAdmin;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
编辑3:
这些是 phpMyAdmin 文件的权限:
# ll
total 692
-rw-r--r--. 1 nginx nginx 1569 Jan 17 14:21 browse_foreigners.php
-rw-r--r--. 1 nginx nginx 4829 Jan 17 14:21 changelog.php
-rw-r--r--. 1 nginx nginx 308 Jan 17 14:21 chk_rel.php
-rw-r--r--. 1 nginx nginx 852 Jan 17 14:21 composer.json
-rwxr-xr-x. 1 nginx nginx 4236 Jan 23 15:18 config.inc.php
-rw-r--r--. 1 nginx nginx 4236 Jan 17 14:21 config.sample.inc.php
-rw-r--r--. 1 nginx nginx 4178 Jan 17 14:21 db_create.php
-rw-r--r--. 1 nginx nginx 8870 Jan 17 14:21 db_datadict.php
-rw-r--r--. 1 nginx nginx 401 Jan 17 14:21 db_events.php
-rw-r--r--. 1 nginx nginx 2788 Jan 17 14:21 db_export.php
-rw-r--r--. 1 nginx nginx 505 Jan 17 14:21 db_import.php
-rw-r--r--. 1 nginx nginx 9297 Jan 17 14:21 db_operations.php
-rw-r--r--. 1 nginx nginx 5269 Jan 17 14:21 db_printview.php
-rw-r--r--. 1 nginx nginx 1987 Jan 17 14:21 db_qbe.php
-rw-r--r--. 1 nginx nginx 454 Jan 17 14:21 db_routines.php
-rw-r--r--. 1 nginx nginx 1636 Jan 17 14:21 db_search.php
-rw-r--r--. 1 nginx nginx 872 Jan 17 14:21 db_sql.php
-rw-r--r--. 1 nginx nginx 9465 Jan 17 14:21 db_structure.php
-rw-r--r--. 1 nginx nginx 8277 Jan 17 14:21 db_tracking.php
-rw-r--r--. 1 nginx nginx 364 Jan 17 14:21 db_triggers.php
drwxr-xr-x. 5 nginx nginx 4096 Jan 23 15:00 doc
-rw-r--r--. 1 nginx nginx 3122 Jan 17 14:21 error_report.php
drwxr-xr-x. 2 nginx nginx 4096 Jan 23 15:00 examples
-rw-r--r--. 1 nginx nginx 37639 Jan 17 14:21 export.php
-rw-r--r--. 1 nginx nginx 18902 Jan 17 14:21 favicon.ico
-rw-r--r--. 1 nginx nginx 2143 Jan 17 14:21 file_echo.php
-rw-r--r--. 1 nginx nginx 15581 Jan 17 14:21 gis_data_editor.php
-rw-r--r--. 1 nginx nginx 21171 Jan 17 14:21 import.php
-rw-r--r--. 1 nginx nginx 2679 Jan 17 14:21 import_status.php
-rw-r--r--. 1 nginx nginx 19846 Jan 17 14:21 index.php
drwxr-xr-x. 9 nginx nginx 4096 Jan 23 15:00 js
drwxr-xr-x. 13 nginx nginx 12288 Jan 23 15:00 libraries
-rw-r--r--. 1 nginx nginx 728 Jan 17 14:21 license.php
drwxr-xr-x. 42 nginx nginx 4096 Jan 23 15:00 locale
-rw-r--r--. 1 nginx nginx 1988 Jan 17 14:21 navigation.php
-rw-r--r--. 1 nginx nginx 389 Jan 17 14:21 phpinfo.php
-rw-r--r--. 1 nginx nginx 746 Jan 17 14:21 phpmyadmin.css.php
-rw-r--r--. 1 nginx nginx 1808 Jan 17 14:21 phpunit.xml.nocoverage
-rw-r--r--. 1 nginx nginx 2051 Jan 17 14:21 pmd_display_field.php
-rw-r--r--. 1 nginx nginx 36692 Jan 17 14:21 pmd_general.php
-rw-r--r--. 1 nginx nginx 5081 Jan 17 14:21 pmd_pdf.php
-rw-r--r--. 1 nginx nginx 4560 Jan 17 14:21 pmd_relation_new.php
-rw-r--r--. 1 nginx nginx 2194 Jan 17 14:21 pmd_relation_upd.php
-rw-r--r--. 1 nginx nginx 2589 Jan 17 14:21 pmd_save_pos.php
-rw-r--r--. 1 nginx nginx 2594 Jan 17 14:21 prefs_forms.php
-rw-r--r--. 1 nginx nginx 14308 Jan 17 14:21 prefs_manage.php
-rw-r--r--. 1 nginx nginx 1213 Jan 17 14:21 print.css
-rw-r--r--. 1 nginx nginx 6222 Jan 17 14:21 querywindow.php
-rw-r--r--. 1 nginx nginx 4004 Jan 17 14:21 schema_edit.php
-rw-r--r--. 1 nginx nginx 1734 Jan 17 14:21 schema_export.php
-rw-r--r--. 1 nginx nginx 1075 Jan 17 14:21 server_binlog.php
-rw-r--r--. 1 nginx nginx 735 Jan 17 14:21 server_collations.php
-rw-r--r--. 1 nginx nginx 2634 Jan 17 14:21 server_databases.php
-rw-r--r--. 1 nginx nginx 615 Jan 17 14:21 server_engines.php
-rw-r--r--. 1 nginx nginx 698 Jan 17 14:21 server_export.php
-rw-r--r--. 1 nginx nginx 452 Jan 17 14:21 server_import.php
-rw-r--r--. 1 nginx nginx 1465 Jan 17 14:21 server_plugins.php
-rw-r--r--. 1 nginx nginx 11668 Jan 17 14:21 server_privileges.php
-rw-r--r--. 1 nginx nginx 2054 Jan 17 14:21 server_replication.php
-rw-r--r--. 1 nginx nginx 577 Jan 17 14:21 server_sql.php
-rw-r--r--. 1 nginx nginx 889 Jan 17 14:21 server_status_advisor.php
-rw-r--r--. 1 nginx nginx 3538 Jan 17 14:21 server_status_monitor.php
-rw-r--r--. 1 nginx nginx 1369 Jan 17 14:21 server_status.php
-rw-r--r--. 1 nginx nginx 1663 Jan 17 14:21 server_status_queries.php
-rw-r--r--. 1 nginx nginx 1507 Jan 17 14:21 server_status_variables.php
-rw-r--r--. 1 nginx nginx 1625 Jan 17 14:21 server_user_groups.php
-rw-r--r--. 1 nginx nginx 1283 Jan 17 14:21 server_variables.php
drwxr-xr-x. 4 nginx nginx 4096 Jan 23 15:00 setup
-rw-r--r--. 1 nginx nginx 1039 Jan 17 14:21 show_config_errors.php
-rw-r--r--. 1 nginx nginx 5507 Jan 17 14:21 sql.php
-rw-r--r--. 1 nginx nginx 3474 Jan 17 14:21 tbl_addfield.php
-rw-r--r--. 1 nginx nginx 5763 Jan 17 14:21 tbl_change.php
-rw-r--r--. 1 nginx nginx 4400 Jan 17 14:21 tbl_chart.php
-rw-r--r--. 1 nginx nginx 2650 Jan 17 14:21 tbl_create.php
-rw-r--r--. 1 nginx nginx 2880 Jan 17 14:21 tbl_export.php
-rw-r--r--. 1 nginx nginx 1657 Jan 17 14:21 tbl_find_replace.php
-rw-r--r--. 1 nginx nginx 1334 Jan 17 14:21 tbl_get_field.php
-rw-r--r--. 1 nginx nginx 3452 Jan 17 14:21 tbl_gis_visualization.php
-rw-r--r--. 1 nginx nginx 590 Jan 17 14:21 tbl_import.php
-rw-r--r--. 1 nginx nginx 1205 Jan 17 14:21 tbl_indexes.php
-rw-r--r--. 1 nginx nginx 2828 Jan 17 14:21 tbl_move_copy.php
-rw-r--r--. 1 nginx nginx 12498 Jan 17 14:21 tbl_operations.php
-rw-r--r--. 1 nginx nginx 1474 Jan 17 14:21 tbl_printview.php
-rw-r--r--. 1 nginx nginx 4616 Jan 17 14:21 tbl_relation.php
-rw-r--r--. 1 nginx nginx 13504 Jan 17 14:21 tbl_replace.php
-rw-r--r--. 1 nginx nginx 3904 Jan 17 14:21 tbl_row_action.php
-rw-r--r--. 1 nginx nginx 2175 Jan 17 14:21 tbl_select.php
-rw-r--r--. 1 nginx nginx 1014 Jan 17 14:21 tbl_sql.php
-rw-r--r--. 1 nginx nginx 4577 Jan 17 14:21 tbl_structure.php
-rw-r--r--. 1 nginx nginx 3927 Jan 17 14:21 tbl_tracking.php
-rw-r--r--. 1 nginx nginx 144 Jan 17 14:21 tbl_triggers.php
-rw-r--r--. 1 nginx nginx 5996 Jan 17 14:21 tbl_zoom_select.php
drwxr-xr-x. 4 nginx nginx 4096 Jan 23 15:00 themes
-rw-r--r--. 1 nginx nginx 863 Jan 17 14:21 themes.php
-rw-r--r--. 1 nginx nginx 1348 Jan 17 14:21 transformation_overview.php
-rw-r--r--. 1 nginx nginx 3961 Jan 17 14:21 transformation_wrapper.php
-rw-r--r--. 1 nginx nginx 507 Jan 17 14:21 url.php
-rw-r--r--. 1 nginx nginx 6883 Jan 17 14:21 user_password.php
-rw-r--r--. 1 nginx nginx 550 Jan 17 14:21 version_check.php
-rw-r--r--. 1 nginx nginx 8914 Jan 17 14:21 view_create.php
-rw-r--r--. 1 nginx nginx 3613 Jan 17 14:21 view_operations.php
-rw-r--r--. 1 nginx nginx 1128 Jan 17 14:21 webapp.php
最佳答案
我找到了解决方案。
/var/lib/php/session/ 文件夹不能被 nginx/php-fpm 写入,我刚刚将权限编辑为 777 现在它可以工作了。
关于phpMyAdmin 无法在带有 PHP5.5.8 的 CentOS 6.5 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21261825/
总的来说,我对ruby还比较陌生,我正在为我正在创建的对象编写一些rspec测试用例。许多测试用例都非常基础,我只是想确保正确填充和返回值。我想知道是否有办法使用循环结构来执行此操作。不必为我要测试的每个方法都设置一个assertEquals。例如:describeitem,"TestingtheItem"doit"willhaveanullvaluetostart"doitem=Item.new#HereIcoulddotheitem.name.shouldbe_nil#thenIcoulddoitem.category.shouldbe_nilendend但我想要一些方法来使用
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
在选择我想要运行操作的频率时,唯一的选项是“每天”、“每小时”和“每10分钟”。谢谢!我想为我的Rails3.1应用程序运行调度程序。 最佳答案 这不是一个优雅的解决方案,但您可以安排它每天运行,并在实际开始工作之前检查日期是否为当月的第一天。 关于ruby-如何每月在Heroku运行一次Scheduler插件?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/8692687/
我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在
exe应该在我打开页面时运行。异步进程需要运行。有什么方法可以在ruby中使用两个参数异步运行exe吗?我已经尝试过ruby命令-system()、exec()但它正在等待过程完成。我需要用参数启动exe,无需等待进程完成是否有任何rubygems会支持我的问题? 最佳答案 您可以使用Process.spawn和Process.wait2:pid=Process.spawn'your.exe','--option'#Later...pid,status=Process.wait2pid您的程序将作为解释器的子进程执行。除
我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳
Sinatra新手;我正在运行一些rspec测试,但在日志中收到了一堆不需要的噪音。如何消除日志中过多的噪音?我仔细检查了环境是否设置为:test,这意味着记录器级别应设置为WARN而不是DEBUG。spec_helper:require"./app"require"sinatra"require"rspec"require"rack/test"require"database_cleaner"require"factory_girl"set:environment,:testFactoryGirl.definition_file_paths=%w{./factories./test/
我在pry中定义了一个函数:to_s,但我无法调用它。这个方法去哪里了,怎么调用?pry(main)>defto_spry(main)*'hello'pry(main)*endpry(main)>to_s=>"main"我的ruby版本是2.1.2看了一些答案和搜索后,我认为我得到了正确的答案:这个方法用在什么地方?在irb或pry中定义方法时,会转到Object.instance_methods[1]pry(main)>defto_s[1]pry(main)*'hello'[1]pry(main)*end=>:to_s[2]pry(main)>defhello[2]pry(main)