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. thx gec
Here is what I did to get it fixed Created upload and save directories Code: 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 Code: nano /etc/phpmyadmin/config.inc.php Added the path for both upload and save directories Code: $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 Code: post_max_size = upload_max_filesize = to suit my needs. Then restarted php and nginx for new settings to take effect Code: /etc/init.d/php5-fpm restart service nginx restart
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. gec
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?
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?
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 Code: :/var/www/clients/[client_username]/ 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.
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.
Hello , i found your old article on google. I had the same problem and now i got a success Code: $dir = $_SERVER['DOCUMENT_ROOT']; $cfg['UploadDir'] = $dir . '/../tmp'; $cfg['SaveDir'] = $dir . '/../tmp'; this will backup the database in the clients tmp folder you dont need to change permissions or basedir directives Greetings Stefan