

<http://aws-infomation-agency.com/?p=58>  
上記のサイトを参考にして、phpmyadminをインストールしたのですが、該当のページにアクセスするとファイルがダウンロードされてしまい、phpMyAdminの画面が出ません。  
どのような原因が考えられますでしょうか。

phpmyadminのバージョンは4.4.14は使用しています。

よろしくお願いいたします。

追記：  
AWSでAmazon Linux を使用しています。  
Webサーバは nginx です。  
phpのバージョンは申し訳ありませんが、わかりません。  
よろしくお願いいたします。

\----------php-fpm.conf--------------------

[code]

    ;;;;;;;;;;;;;;;;;;;;;
    ; FPM Configuration ;
    ;;;;;;;;;;;;;;;;;;;;;
    
    ; All relative paths in this configuration file are relative to PHPs install
    ; prefix.
    
    ; Include one or more files. If glob(3) exists, it is used to include a bunch of
    ; files from a glob(3) pattern. This directive can be used everywhere in the
    ; file.
    include=/etc/php-fpm.d/*.conf
    
    ;;;;;;;;;;;;;;;;;;
    ; Global Options ;
    ;;;;;;;;;;;;;;;;;;
    
    [global]
    ; Pid file
    ; Default Value: none
    pid = /var/run/php-fpm/php-fpm.pid
    
    ; Error log file
    ; Default Value: /var/log/php-fpm.log
    error_log = /var/log/php-fpm/error.log
    
    ; Log level
    ; Possible Values: alert, error, warning, notice, debug
    ; Default Value: notice
    ;log_level = notice
    
    ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
    ; interval set by emergency_restart_interval then FPM will restart. A value
    ; of '0' means 'Off'.
    ; Default Value: 0
    ;emergency_restart_threshold = 0
    
    ; Interval of time used by emergency_restart_interval to determine when 
    ; a graceful restart will be initiated.  This can be useful to work around
    ; accidental corruptions in an accelerator's shared memory.
    ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
    ; Default Unit: seconds
    ; Default Value: 0
    ;emergency_restart_interval = 0
    
    ; Time limit for child processes to wait for a reaction on signals from master.
    ; Available units: s(econds), m(inutes), h(ours), or d(ays)
    ; Default Unit: seconds
    ; Default Value: 0
    ;process_control_timeout = 0
    
    ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
    ; Default Value: yes
    ;daemonize = yes
    
    ;;;;;;;;;;;;;;;;;;;;
    ; Pool Definitions ; 
    ;;;;;;;;;;;;;;;;;;;;
    
    ; See /etc/php-fpm.d/*.conf
    
[/code]

\------------www.conf--------------------------

[code]

    ; Start a new pool named 'www'.
    [www]
    
    ; The address on which to accept FastCGI requests.
    ; Valid syntaxes are:
    ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
    ;                            a specific port;
    ;   'port'                 - to listen on a TCP socket to all addresses on a
    ;                            specific port;
    ;   '/path/to/unix/socket' - to listen on a unix socket.
    ; Note: This value is mandatory.
    listen = 127.0.0.1:9000
    
    ; Set listen(2) backlog. A value of '-1' means unlimited.
    ; Default Value: -1
    ;listen.backlog = -1
    
    ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
    ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
    ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
    ; must be separated by a comma. If this value is left blank, connections will be
    ; accepted from any ip address.
    ; Default Value: any
    listen.allowed_clients = 127.0.0.1
    
    ; Set permissions for unix socket, if one is used. In Linux, read/write
    ; permissions must be set in order to allow connections from a web server. Many
    ; BSD-derived systems allow connections regardless of permissions. 
    ; Default Values: user and group are set as the running user
    ;                 mode is set to 0666
    ;listen.owner = nobody
    ;listen.group = nobody
    ;listen.mode = 0666
    
    ; Unix user/group of processes
    ; Note: The user is mandatory. If the group is not set, the default users group
    ;       will be used.
    ; RPM: apache Choosed to be able to access some dir as httpd
    user = nginx
    ; RPM: Keep a group allowed to write in log dir.
    group = nginx
    
    ; Choose how the process manager will control the number of child processes.
    ; Possible Values:
    ;   static  - a fixed number (pm.max_children) of child processes;
    ;   dynamic - the number of child processes are set dynamically based on the
    ;             following directives:
    ;             pm.max_children      - the maximum number of children that can
    ;                                    be alive at the same time.
    ;             pm.start_servers     - the number of children created on startup.
    ;             pm.min_spare_servers - the minimum number of children in 'idle'
    ;                                    state (waiting to process). If the number
    ;                                    of 'idle' processes is less than this
    ;                                    number then some children will be created.
    ;             pm.max_spare_servers - the maximum number of children in 'idle'
    ;                                    state (waiting to process). If the number
    ;                                    of 'idle' processes is greater than this
    ;                                    number then some children will be killed.
    ; Note: This value is mandatory.
    pm = dynamic
    
    ; The number of child processes to be created when pm is set to 'static' and the
    ; maximum number of child processes to be created when pm is set to 'dynamic'.
    ; This value sets the limit on the number of simultaneous requests that will be
    ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
    ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
    ; CGI.
    ; Note: Used when pm is set to either 'static' or 'dynamic'
    ; Note: This value is mandatory.
    pm.max_children = 50
    
    ; The number of child processes created on startup.
    ; Note: Used only when pm is set to 'dynamic'
    ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
    pm.start_servers = 5
    
    ; The desired minimum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.min_spare_servers = 5
    
    ; The desired maximum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.max_spare_servers = 35
    
    ; The number of requests each child process should execute before respawning.
    ; This can be useful to work around memory leaks in 3rd party libraries. For
    ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
    ; Default Value: 0
    ;pm.max_requests = 500
    
    ; The URI to view the FPM status page. If this value is not set, no URI will be
    ; recognized as a status page. By default, the status page shows the following
    ; information:
    ;   accepted conn    - the number of request accepted by the pool;
    ;   pool             - the name of the pool;
    ;   process manager  - static or dynamic;
    ;   idle processes   - the number of idle processes;
    ;   active processes - the number of active processes;
    ;   total processes  - the number of idle + active processes.
    ; The values of 'idle processes', 'active processes' and 'total processes' are
    ; updated each second. The value of 'accepted conn' is updated in real time.
    ; Example output:
    ;   accepted conn:   12073
    ;   pool:             www
    ;   process manager:  static
    ;   idle processes:   35
    ;   active processes: 65
    ;   total processes:  100
    ; By default the status page output is formatted as text/plain. Passing either
    ; 'html' or 'json' as a query string will return the corresponding output
    ; syntax. Example:
    ;   http://www.foo.bar/status
    ;   http://www.foo.bar/status?json
    ;   http://www.foo.bar/status?html
    ; Note: The value must start with a leading slash (/). The value can be
    ;       anything, but it may not be a good idea to use the .php extension or it
    ;       may conflict with a real PHP file.
    ; Default Value: not set 
    ;pm.status_path = /status
    
    ; The ping URI to call the monitoring page of FPM. If this value is not set, no
    ; URI will be recognized as a ping page. This could be used to test from outside
    ; that FPM is alive and responding, or to
    ; - create a graph of FPM availability (rrd or such);
    ; - remove a server from a group if it is not responding (load balancing);
    ; - trigger alerts for the operating team (24/7).
    ; Note: The value must start with a leading slash (/). The value can be
    ;       anything, but it may not be a good idea to use the .php extension or it
    ;       may conflict with a real PHP file.
    ; Default Value: not set
    ;ping.path = /ping
    
    ; This directive may be used to customize the response of a ping request. The
    ; response is formatted as text/plain with a 200 response code.
    ; Default Value: pong
    ;ping.response = pong
    
    ; The timeout for serving a single request after which the worker process will
    ; be killed. This option should be used when the 'max_execution_time' ini option
    ; does not stop script execution for some reason. A value of '0' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    ;request_terminate_timeout = 0
    
    ; The timeout for serving a single request after which a PHP backtrace will be
    ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    ;request_slowlog_timeout = 0
    
    ; The log file for slow requests
    ; Default Value: not set
    ; Note: slowlog is mandatory if request_slowlog_timeout is set
    slowlog = /var/log/php-fpm/www-slow.log
    
    ; Set open file descriptor rlimit.
    ; Default Value: system defined value
    ;rlimit_files = 1024
    
    ; Set max core size rlimit.
    ; Possible Values: 'unlimited' or an integer greater or equal to 0
    ; Default Value: system defined value
    ;rlimit_core = 0
    
    ; Chroot to this directory at the start. This value must be defined as an
    ; absolute path. When this value is not set, chroot is not used.
    ; Note: chrooting is a great security feature and should be used whenever 
    ;       possible. However, all PHP paths will be relative to the chroot
    ;       (error_log, sessions.save_path, ...).
    ; Default Value: not set
    ;chroot = 
    
    ; Chdir to this directory at the start. This value must be an absolute path.
    ; Default Value: current directory or / when chroot
    ;chdir = /var/www
    
    ; Redirect worker stdout and stderr into main error log. If not set, stdout and
    ; stderr will be redirected to /dev/null according to FastCGI specs.
    ; Default Value: no
    ;catch_workers_output = yes
    
    ; Limits the extensions of the main script FPM will allow to parse. This can
    ; prevent configuration mistakes on the web server side. You should only limit
    ; FPM to .php extensions to prevent malicious users to use other extensions to
    ; exectute php code.
    ; Note: set an empty value to allow all extensions.
    ; Default Value: .php
    ;security.limit_extensions = .php .php3 .php4 .php5
    
    ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
    ; the current environment.
    ; Default Value: clean env
    ;env[HOSTNAME] = $HOSTNAME
    ;env[PATH] = /usr/local/bin:/usr/bin:/bin
    ;env[TMP] = /tmp
    ;env[TMPDIR] = /tmp
    ;env[TEMP] = /tmp
    
    ; Additional php.ini defines, specific to this pool of workers. These settings
    ; overwrite the values previously defined in the php.ini. The directives are the
    ; same as the PHP SAPI:
    ;   php_value/php_flag             - you can set classic ini defines which can
    ;                                    be overwritten from PHP call 'ini_set'. 
    ;   php_admin_value/php_admin_flag - these directives wont be overwritten by
    ;                                     PHP call 'ini_set'
    ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
    
    ; Defining 'extension' will load the corresponding shared extension from
    ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
    ; overwrite previously defined php.ini values, but will append the new value
    ; instead.
    
    ; Default Value: nothing is defined by default except the values in php.ini and
    ;                specified at startup with the -d argument
    ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
    ;php_flag[display_errors] = off
    php_admin_value[error_log] = /var/log/php-fpm/www-error.log
    php_admin_flag[log_errors] = on
    ;php_admin_value[memory_limit] = 32M
    
[/code]

\---------------conig.inc.php--------------------

[code]

    <?php
    /* vim: set expandtab sw=4 ts=4 sts=4: */
    /**
     * phpMyAdmin sample configuration, you can use it as base for
     * manual configuration. For easier setup you can use setup/
     *
     * All directives are explained in documentation in the doc/ folder
     * or at <http://docs.phpmyadmin.net/>.
     *
     * @package PhpMyAdmin
     */
    
    /*
     * This is needed for cookie based authentication to encrypt password in
     * cookie
     */
    $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
    
    /*
     * Servers configuration
     */
    $i = 0;
    
    /*
     * First server
     */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    
    /*
     * phpMyAdmin configuration storage settings.
     */
    
    /* User used to manipulate with storage */
    // $cfg['Servers'][$i]['controlhost'] = '';
    // $cfg['Servers'][$i]['controlport'] = '';
    // $cfg['Servers'][$i]['controluser'] = 'pma';
    // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
    
    /* Storage database and tables */
    // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
    // $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
    // $cfg['Servers'][$i]['relation'] = 'pma__relation';
    // $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
    // $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
    // $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
    // $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
    // $cfg['Servers'][$i]['history'] = 'pma__history';
    // $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
    // $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
    // $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
    // $cfg['Servers'][$i]['recent'] = 'pma__recent';
    // $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
    // $cfg['Servers'][$i]['users'] = 'pma__users';
    // $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
    // $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
    // $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
    // $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
    /* Contrib / Swekey authentication */
    // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
    
    /*
     * End of servers configuration
     */
    
    /*
     * Directories for saving/loading files from server
     */
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';
    
    /**
     * Whether to display icons or text or both icons and text in table row
     * action segment. Value can be either of 'icons', 'text' or 'both'.
     */
    //$cfg['RowActionType'] = 'both';
    
    /**
     * Defines whether a user should be displayed a "show all (records)"
     * button in browse mode or not.
     * default = false
     */
    //$cfg['ShowAll'] = true;
    
    /**
     * Number of rows displayed when browsing a result set. If the result
     * set contains more rows, "Previous" and "Next".
     * default = 30
     */
    //$cfg['MaxRows'] = 50;
    
    /**
     * disallow editing of binary fields
     * valid values are:
     *   false    allow editing
     *   'blob'   allow editing except for BLOB fields
     *   'noblob' disallow editing except for BLOB fields
     *   'all'    disallow editing
     * default = blob
     */
    //$cfg['ProtectBinary'] = 'false';
    
    /**
     * Default language to use, if not browser-defined or user-defined
     * (you find all languages in the locale folder)
     * uncomment the desired line:
     * default = 'en'
     */
    //$cfg['DefaultLang'] = 'en';
    //$cfg['DefaultLang'] = 'de';
    
    /**
     * How many columns should be used for table display of a database?
     * (a value larger than 1 results in some information being hidden)
     * default = 1
     */
    //$cfg['PropertiesNumColumns'] = 2;
    
    /**
     * Set to true if you want DB-based query history.If false, this utilizes
     * JS-routines to display query history (lost by window close)
     *
     * This requires configuration storage enabled, see above.
     * default = false
     */
    //$cfg['QueryHistoryDB'] = true;
    
    /**
     * When using DB-based query history, how many entries should be kept?
     *
     * default = 25
     */
    //$cfg['QueryHistoryMax'] = 100;
    
    /**
     * Should error reporting be enabled for JavaScript errors
     *
     * default = 'ask'
     */
    //$cfg['SendErrorReports'] = 'ask';
    
    /*
     * You can find more configuration options in the documentation
     * in the doc/ folder or at <http://docs.phpmyadmin.net/>.
     */
    
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = '';
    $cfg['Servers'][$i]['port'] = '3306';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    $cfg['Servers'][$i]['extension'] = 'mysql';
    ?>
    
[/code]

\--------------fastcgi_params----------------------------

[code]

    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    fastcgi_param  HTTPS              $https if_not_empty;
    
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
    
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    
    # PHP only, required if PHP was built with --enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;
    
[/code]

\----------------------nginx.conf----------------------------------

[code]

    # For more information on configuration, see:
    #   * Official English Documentation: http://nginx.org/en/docs/
    #   * Official Russian Documentation: http://nginx.org/ru/docs/
    
    user  nginx;
    worker_processes  1;
    
    error_log  /var/log/nginx/error.log;
    #error_log  /var/log/nginx/error.log  notice;
    #error_log  /var/log/nginx/error.log  info;
    
    pid        /var/run/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        #gzip  on;
    
        # Load modular configuration files from the /etc/nginx/conf.d directory.
        # See http://nginx.org/en/docs/ngx_core_module.html#include
        # for more information.
        include /etc/nginx/conf.d/*.conf;
    
        index   index.html index.htm;
    
        server {
            listen       80;
            server_name  localhost;
            root         /var/www/html;
    
            #charset koi8-r;
    
            #access_log  /var/log/nginx/host.access.log  main;
    
            location / {
            #root   /usr/share/nginx/html;
                    root   /var/www/html;
                    index  index.html index.htm index.php;
        }
    
            # redirect server error pages to the static page /40x.html
            #
            error_page  404              /404.html;
            location = /40x.html {
            }
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
            }
    
            # proxy the PHP scripts to Apache listening on 127.0.0.1:80
            #
            #location ~ \.php$ {
            #    proxy_pass   http://127.0.0.1;
            #}
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            location ~ \.php$ {
                root           /var/www/html;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name;
                include        fastcgi_params;
            }
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginxs one
            #
            #location ~ /\.ht {
            #    deny  all;
            #}
        }
    
    
        # another virtual host using mix of IP-, name-, and port-based configuration
        #
        #server {
        #    listen       8000;
        #    listen       somename:8080;
        #    server_name  somename  alias  another.alias;
        #    root         html;
    
        #    location / {
        #    }
        #}
    
    
        # HTTPS server
        #
        #server {
        #    listen       443;
        #    server_name  localhost;
        #    root         html;
    
        #    ssl                  on;
        #    ssl_certificate      cert.pem;
        #    ssl_certificate_key  cert.key;
    
        #    ssl_session_timeout  5m;
    
        #    ssl_protocols  SSLv2 SSLv3 TLSv1;
        #    ssl_ciphers  HIGH:!aNULL:!MD5;
        #    ssl_prefer_server_ciphers   on;
    
        #    location / {
        #    }
        #}
    
    }
    
[/code]


CC BY-SA 3.0
2015-08-28T04:39:55.970
14932
2015-08-31T13:34:07.310
2015-08-31T13:34:07.310
8619
8619
question
php aws nginx phpmyadmin
phpmyadminが表示されない


php -v  
というコマンドを入力してインストールされているかどうか確かめましょう。  
インストールされていなければ、下記のコマンドでインストールしましょう  
yum -y install php php-pear php-mysql php-mbstring php-gd php-mcrypt php-pecl-
apc


CC BY-SA 3.0
2015-08-28T06:44:41.373
14940
2015-08-28T06:44:41.373
525
14932
answer


.phpファイルがダウンロードされるのだと思いますが、WebサーバーでMIMEを設定しないとダウンロードされます。apacheの場合は`yum
install
php`すると適切に設定ファイルが作成されますがnginxの場合はphpを動かすために手動で設定が必要です。phpを動かす設定はいくつか有りますが php-
fpm (FastCGI Process Manager) を使う場合が多い(？)と思いますのでその手順を書きます。

# nginxでphpを動かす (php-fpmの場合)

php-fpmをインストールします。

[code]

    $ sudo yum install php-fpm
    
[/code]

デフォルトではapache向けなのでnginx向けに設定を変えます。

[code]

    $ sudoedit /etc/php-fpm.d/www.conf
    
[/code]

> user = nginx ← nginxに書き換える  
>  group = nginx ← nginxに書き換える

nginxでphp-fpmを有効化します。(コメントアウトされているのでコメントを外して、パスを書き換えます)

[code]

    $ sudoedit /etc/nginx/nginx.conf
    
[/code]

>
[code]

>        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
>        #
>        location ~ \.php$ {
>            root           html;
>            fastcgi_pass   127.0.0.1:9000;
>            fastcgi_index  index.php;
>            fastcgi_param  SCRIPT_FILENAME
> /usr/share/nginx/html$fastcgi_script_name;
>            include        fastcgi_params;
>        }
>  
[/code]

php-fpmを起動します。

[code]

    $ sudo service php-fpm start
    
[/code]

# phpMyAdmin を インストール

phpMyAdmin を /usr/share/nginx/html の下に展開します。  
(参照先のブログと同じなので手順省略)

依存パッケージをインストールします。（@Taizan Yonetujiさんの回答を引用)

> yum -y install php php-pear php-mysql php-mbstring php-gd php-mcrypt php-
> pecl-apc

/var/lib/php/session のパーミッションがないので変更

[code]

    $ sudo chown -R root:nginx /var/lib/php/session
    
[/code]

`config.inc.php` の設定を変更します。

[code]

    $ sudoedit /usr/share/nginx/html/phpMyAdmin/config.inc.php
    
[/code]

> /* Server parameters */  
>  $cfg['Servers'][$i]['host'] = '******.rds.amazonaws.com';
> ←mysqlのサーバー明。RDSの場合はインスタンスのエンドポイントを記述  
>  $cfg['Servers'][$i]['port'] = '3306'; ←mysqlのポート番号  
>  $cfg['Servers'][$i]['connect_type'] = 'tcp';  
>  $cfg['Servers'][$i]['compress'] = false;  
>  $cfg['Servers'][$i]['AllowNoPassword'] = false;  
>  $cfg['Servers'][$i]['extension'] = 'mysql'; ←mysql拡張モジュール

php-fpmとnginxを再起動します(不要かも)

[code]

    $ sudo service php-fpm restart
    $ sudo service nginx restart
    
[/code]

[http://ホスト名_OR_IPアドレス/phpMyAdmin/index.php](http://%E3%83%9B%E3%82%B9%E3%83%88%E5%90%8D_OR_IP%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9/phpMyAdmin/index.php)
にアクセスするとphpMyAdminの画面が開くと思います。

# (おまけ) EPELからインストールする場合

お手軽な解決方法として phpMyAdmin のバージョンがちょっと古いですが EPEL から phpMyAdmin をインストールする方法があります。

[code]

    $ sudo yum install php
    $ sudo yum --enablerepo=epel install phpMyAdmin
    $ sudo service httpd restart
    
[/code]

これで php と関連パッケージ、httpd (Apache)、phpMyAdmin が入るので  
http://＜ホスト名＞/phpMyAdmin/ でアクセスできます。

※現在の EPEL 版のバージョンは 4.0.10.10 でした。

# (参考) 設定ファイル

/etc/php-fpm.conf

[code]

    include=/etc/php-fpm.d/*.conf
    [global]
    pid = /var/run/php-fpm/php-fpm.pid
    error_log = /var/log/php-fpm/error.log
    
[/code]

/etc/php-fpm.d/www.conf

[code]

    [www]
    listen = 127.0.0.1:9000
    listen.allowed_clients = 127.0.0.1
    user = nginx
    group = nginx
    pm = dynamic
    pm.max_children = 50
    pm.start_servers = 5
    pm.min_spare_servers = 5
    pm.max_spare_servers = 35
    slowlog = /var/log/php-fpm/www-slow.log
    php_admin_value[error_log] = /var/log/php-fpm/www-error.log
    php_admin_flag[log_errors] = on
    
[/code]

/etc/nginx/nginx.conf

[code]

    user  nginx;
    worker_processes  1;
    error_log  /var/log/nginx/error.log;
    pid        /var/run/nginx.pid;
    events {
        worker_connections  1024;
    }
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /var/log/nginx/access.log  main;
        sendfile        on;
        keepalive_timeout  65;
        include /etc/nginx/conf.d/*.conf;
        index   index.html index.htm;
        server {
            listen       80;
            server_name  localhost;
            root         /usr/share/nginx/html;
            location / {
            }
            error_page  404              /404.html;
            location = /40x.html {
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
            }
            location ~ \.php$ {
                root           html;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
                include        fastcgi_params;
            }
        }
    }
    
[/code]

/etc/nginx/fastcgi_params

[code]

    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    fastcgi_param  HTTPS              $https if_not_empty;
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    fastcgi_param  REDIRECT_STATUS    200;
    
[/code]

/usr/share/nginx/html/phpMyAdmin/config.inc.php

[code]

    <?php
    $cfg['blowfish_secret'] = '00000000111111112222222233333333';
    $i = 0;
    $i++;
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['host'] = 'hogehoge.rds.amazonaws.com';
    $cfg['Servers'][$i]['port'] = '3306';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    $cfg['Servers'][$i]['extension'] = 'mysql';
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';
    ?>
    
[/code]


CC BY-SA 3.0
2015-08-28T06:58:33.660
14941
2015-08-29T05:18:09.550
2015-08-29T05:18:09.550
5008
5008
14932
answer