Want more timely Centmin Mod News Updates?
Become a Member

phpmyadmin.sh Addon

Discussion in 'Add Ons' started by eva2000, May 25, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    can you post the output for below command to gist.github.com or pastebin.com masking any sensitive info
    Code (Text):
    bash -x /root/tools/phpmyadmin_update.sh
    

    Code (Text):
    /root/tools/phpmyadmin_update.sh: line 18: php: command not found
    

    is php properly installed too ? what's output for
    Code (Text):
    php -v
    

     
  2. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    • Like Like x 1
  3. dcg

    dcg Member

    53
    18
    8
    Oct 17, 2015
    Florida, USA
    Ratings:
    +34
    Local Time:
    3:58 PM
    1.15.x
    10.2.x
    I modified the phpmyadmin_update.sh adding the rm for composer.lock
    That fixed the git merge error, and it was able to pull down the latest phpmyadmin version.

    When I run bash -x on phpmyadmin_update.sh
    I get this output. Everything runs fine no errors. gist:040430936aef39bb8910f0e889652f57 · GitHub

    However I also ran the cron job again to test it.
    Crontab job with execution of: /root/tools/phpmyadmin_update.sh
    this has the php error as seen by the log file gist:8bea31ed5ca86a0017454b5498b13ec2 · GitHub

    php -v
    Code:
    PHP 7.1.10 (cli) (built: Oct  6 2017 02:05:14) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.1.10, Copyright (c) 1999-2017, by Zend Technologies
     
  4. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    does it work if you edit phpmyadmin_update.sh and add to 2nd line of the script an export path
    Code (Text):
    #!/bin/bash
    export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
    
     
    • Like Like x 1
  5. dcg

    dcg Member

    53
    18
    8
    Oct 17, 2015
    Florida, USA
    Ratings:
    +34
    Local Time:
    3:58 PM
    1.15.x
    10.2.x
    Code:
    git pull
    Already up-to-date.
    2017-10-27 18:41:02 URL:https://getcomposer.org/composer.phar [1852795/1852795] -> "composer.phar" [1]
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Loading composer repositories with package information
    Updating dependencies
    Writing lock file
    Generating autoload files
    
    Total phpmyadmin Update Time: 2.841839800 seconds
    Edited and let cron run. Works no php error. Thank you

    Do you know why cron wouldn't have proper PATH set?
     
    • Informative Informative x 1
  6. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    it should if you're using 123.09beta01 based server. It does for me. But think updated fix will make sure it does work now :)
     
    • Agree Agree x 1
  7. dcg

    dcg Member

    53
    18
    8
    Oct 17, 2015
    Florida, USA
    Ratings:
    +34
    Local Time:
    3:58 PM
    1.15.x
    10.2.x
    I did a fresh install of 123.09beta01 at the start of October.
    I ran a cronjob of env to dump what the environment is:
    Code:
    XDG_SESSION_ID=8697
    SHELL=/bin/sh
    USER=root
    PATH=/usr/bin:/bin
    PWD=/root
    LANG=en_US.UTF-8
    SHLVL=1
    HOME=/root
    LOGNAME=root
    XDG_RUNTIME_DIR=/run/user/0
    _=/usr/bin/env
    That was output. Should I edit crontab to add
    PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
    at the top?
     
  8. pamamolf

    pamamolf Premium Member Premium Member

    3,456
    331
    83
    May 31, 2014
    Ratings:
    +635
    Local Time:
    10:58 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    George can you please remind me if we need to manually update that script or general Centminmod update menu function is taking care of it?
     
  9. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    that PATH is incorrect... contents of /root/.bashrc should have something like - look at PATH export line
    Code (Text):
    # .bashrc
    
    # User specific aliases and functions
    
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    
    # Source global definitions
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi
    alias wget='/usr/local/bin/wget'
    alias pwdh='echo -n "$HOSTNAME"; echo " $PWD"'
    HISTTIMEFORMAT="[%d.%m.%y] %T   "
    export HISTSIZE=10000
    export HISTTIMEFORMAT
    export PS1="[\A][\[email protected]\H \W]\\$ "
    export CCACHE_DIR="/home/.ccache"
    export CC="ccache gcc"
    export CXX="ccache g++"
    export CCACHE_CPP2=yes
    export PATH="$PATH:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
    alias postfixlog='pflogsumm -d today --verbose_msg_detail /var/log/maillog'
    alias top2="glances"
    alias cmdir='pushd /usr/local/src/centminmod'
    


    the latest fixes are all manually done on your end no automation - you can use phpmyadmin uninstall script, update to latest phpmyadmin.sh and do a reinstall for latest changes too
     
  10. dcg

    dcg Member

    53
    18
    8
    Oct 17, 2015
    Florida, USA
    Ratings:
    +34
    Local Time:
    3:58 PM
    1.15.x
    10.2.x
    The .bashrc for user root is the same you posted.
    If i do env logged in as root this is the output:
    Code:
    XDG_SESSION_ID=8932
    HOSTNAME=
    TERM=xterm-256color
    SHELL=/bin/bash
    HISTSIZE=10000
    SSH_CLIENT=
    SSH_TTY=/dev/pts/0
    USER=root
    LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
    CCACHE_DIR=/home/.ccache
    CCACHE_CPP2=yes
    MAIL=/var/spool/mail/root
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
    PWD=/root
    EDITOR=nano
    LANG=en_US.UTF-8
    PS1=[\A][\[email protected]\H \W]\$
    CXX=ccache g++
    HISTCONTROL=ignoredups
    SHLVL=1
    HOME=/root
    LOGNAME=root
    SSH_CONNECTION=
    LESSOPEN=||/usr/bin/lesspipe.sh %s
    CC=ccache gcc
    XDG_RUNTIME_DIR=/run/user/0
    LE_WORKING_DIR=/root/.acme.sh
    HISTTIMEFORMAT=[%d.%m.%y] %T
    _=/usr/bin/env
    However, if I do env within a cron job.
    The previous env was adding a cron job of
    * * * * * env > /root/env_cron_dump.txt

    So when cron job is run as root it's environment is:
    Code:
    XDG_SESSION_ID=8697
    SHELL=/bin/sh
    USER=root
    PATH=/usr/bin:/bin
    PWD=/root
    LANG=en_US.UTF-8
    SHLVL=1
    HOME=/root
    LOGNAME=root
    XDG_RUNTIME_DIR=/run/user/0
    _=/usr/bin/env
     
  11. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    ah yes crond has it's own environment so the fix i added to set export PATH should fix it

    I could go messing with /etc/crontab set PATH but probably best to leave it for now. Edit centmin mod actually modifies it now I recall, but will check why it isn't being modified

    contents of /etc/crontab
    Code (Text):
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
    MAILTO=root
    
    # For details see man 4 crontabs
    
    # Example of job definition:
    # .---------------- minute (0 - 59)
    # |  .------------- hour (0 - 23)
    # |  |  .---------- day of month (1 - 31)
    # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
    # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    # |  |  |  |  |
    # *  *  *  *  * user-name  command to be executed
    
     
  12. dcg

    dcg Member

    53
    18
    8
    Oct 17, 2015
    Florida, USA
    Ratings:
    +34
    Local Time:
    3:58 PM
    1.15.x
    10.2.x
    That is the same content of my /etc/crontab

    However, the root user crontab -e job's env does not use that PATH var setting.
    I appreciate the fix adding explicit export PATH to phpmyadmin_update.sh, just was curious about the cronjob env for user root. I don't know where it's getting it env from.

    EDIT
    It's even using /bin/sh as shell which looks to link to /bin/dash
     
  13. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yeah it should come from /etc/crontab set PATH but looks like it isn't. For now just do the workaround PATH for existing installs. New phpmyadmin.sh installs will generate the phpmyadmin_update.sh with workaround PATH done already
     
    • Agree Agree x 1
  14. arlon

    arlon Member

    91
    6
    8
    Feb 20, 2016
    Ratings:
    +12
    Local Time:
    2:58 AM
    1.13.6
    10.1
    i just installed phpmyadmin addon on Centmin Mod .09 beta
    but i get error 502 bad gateway when accessing phpmyadmin after filling user/password htaccess

    and also
    Code:
    service nginx restart
    nginx: [warn] invalid parameter "spdy": ngx_http_spdy_module was superseded by ngx_http_v2_module in /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf:3
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
    Stopping nginx:                                            [  OK  ]
    Starting nginx: nginx: [warn] invalid parameter "spdy": ngx_http_spdy_module was superseded by ngx_http_v2_module in /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf:3
                                                               [  OK  ]
    i get this error when restarting nginx:
     
  15. arlon

    arlon Member

    91
    6
    8
    Feb 20, 2016
    Ratings:
    +12
    Local Time:
    2:58 AM
    1.13.6
    10.1
    error log:
    Code:
    2017/11/11 06:18:14 [crit] 5200#5200: *3 connect() to unix:/tmp/phpfpm_myadmin.sock failed (13: Permission denied) while connecting to upstream, client:120.188.72.172, server: li1475-134.members.linode.com, request: "GET /8895_mysqladmin21492/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/phpfpm_myadmyadmin.sock:", host: "li1475-134.members.linode.com"
     
  16. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    how did you install phpmyadmin.sh addon exact commands used ? as the error says spdy is no longer supported HTTPS now uses HTTP/2 which phpmyadmin.sh installs

    If you have some issues, a few things to try for troubleshooting phpmyadmin installs via phpmyadmin.sh addon
    • If you upgraded PHP after you installed phpmyadmin addon, try clearing browser cache and restarting nginx and php-fpm
    • Check nginx error and access log - FAQ item 19 and Config Files page for overview.
    • Ensure you have a valid DNS for the main hostname pointing to your server's IP address
    • Ensure main hostname is setup as per step 1 of Getting Started Guide where main hostname is not the same as a site's nginx vhost domain name. They have to be different as outlined in the difference and summary of Getting Started Guide.
      This allows the main hostname vhost to house all the PHP and nginx statistic pages and phpmyadmin urls.
    • So ensure the server_name listed in main hostname vhost at /usr/local/nginx/conf/conf.d/virtual.conf isn't referenced in other nginx domain vhost files.
    Post contents of these files wrapped in BBCODE CODE tags
    • /usr/local/nginx/conf/conf.d/virtual.conf
    • /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf
    • /usr/local/nginx/conf/phpmyadmin.conf
     
  17. arlon

    arlon Member

    91
    6
    8
    Feb 20, 2016
    Ratings:
    +12
    Local Time:
    2:58 AM
    1.13.6
    10.1
  18. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    phpmyadmin.sh only would use spdy if nginx was older version

    what is output for
    Code (Text):
    nginx -V
    

    wrap in quote tags
     
  19. eva2000

    eva2000 Administrator Staff Member

    41,401
    9,298
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,265
    Local Time:
    5:58 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    also phpmyadmin.sh runs have a log file saved to /root/centminlogs/centminmod_phpmyadmin_install_*.log where * is data timestamp

    to find the file
    Code (Text):
    ls -lahrt /root/centminlogs | grep 'centminmod_phpmyadmin_install'
    

    then post contents of the log file to private gist.github.com or pastebin.com and share the log either via private message to me or mask sensitive info and post link here
     
  20. arlon

    arlon Member

    91
    6
    8
    Feb 20, 2016
    Ratings:
    +12
    Local Time:
    2:58 AM
    1.13.6
    10.1