How to configure phpMyAdmin upload directory

Discussion in 'Installation/Configuration' started by gec, Mar 12, 2014.

  1. gec

    gec New Member

    hi all.

    i'd like to be able to use the option phpMyAdmin offers, to upload sql file using ftp and import it with phpMyAdmin.

    mainly to give my clients option to import large sql files easier.

    not sure what to put in the $cfg['UploadDir'] so it is accessible by clients.


  2. drewb0y

    drewb0y Member

    Did you ever figure this out? If so please post your findings.

  3. gec

    gec New Member

    no. unfortunately. still have not figure this one out.
  4. drewb0y

    drewb0y Member

    Here is what I did to get it fixed

    Created upload and save directories

    mkdir /etc/phpmyadmin/upload
    mkdir /etc/phpmyadmin/save
    chmod a+w /etc/phpmyadmin/upload
    chmod a+w /etc/phpmyadmin/save
    Edited phpmyadmin's config file
    nano /etc/phpmyadmin/
    Added the path for both upload and save directories
    $cfg['UploadDir'] = '/etc/phpmyadmin/upload';
    $cfg['SaveDir'] = '/etc/phpmyadmin/save';
    Log out and relogin to phpmyadmin and that should do it.
    In my case, I also edited php.ini to increase
    post_max_size =
    upload_max_filesize =
    to suit my needs.

    Then restarted php and nginx for new settings to take effect
     /etc/init.d/php5-fpm restart
    service nginx restart
  5. gec

    gec New Member

    Thx drewb0y. Will definitelly try that out!
  6. gec

    gec New Member

    tested this today and probaby should have notice that earlier, but i'm not linux expert.

    this actually works only for admin user with access to /etc/phpmyadmin folder.

    how would i do that so the folder is accessible to other clients, and to be private to that client? would not like all clients to share same folder.

  7. gec

    gec New Member

    i've just learned that "If you want different directory for each user, %u will be replaced with username."

    so we could put /var/www/clients/%u/ to the UploadDir and SaveDir that would bring you to the clients folder. but that folder is still not accessible by the client. inside clients folder is the web[XX] folder that is accessible to the client using ftp. but problem is that this [XX] is diferent for each user.

    can we use some wildcard or something to get inside that web[XX] folder?

    something like /var/www/clients/%u/web* or something?
  8. gec

    gec New Member

    unfortunately the above idea will not work.

    good news is that i've learned that wildcards in path actually do work ( my linux knowledge grows by the seconds :) ) but unfortunately folders inside the /clinets folder are named client0, client1, ... and not by the username.

    so %u wildcard does not work in this case.

    maybe would be possible to automatically add username symlink in the clients folder at the creation of the each new client?
  9. gec

    gec New Member

    one more attempt:

    i've added username symlink to the clients folder linking to users website and added symlink info to the server config -> web -> Website symlinks
    i can see that the path is good in the phpmyadmin File import area but i have the "The directory you set for upload work cannot be reached" error.

    i believe that's permissions problem.
  10. drewb0y

    drewb0y Member

    I guess another alternative would be to just create a user for each one you want to give phpmyadmin access to. But that would be a pain if you have a lot of clients.

    In my particular situation, I don't care if they all share access to one directory. It will be mostly myself who uses it anyway.

    Of course clients can also upload their own phpmyadmin within their web directories.

    Keep us posted as to what you work out in the end.

Share This Page