Saving the export file on the server

Instead of transmitting the export file over the network with HTTP, it is possible to save it directly on the file system of the web server. This could be quicker and less sensitive to execution time limits as the entire transfer from the server to the client browser is bypassed. Eventually, a file transfer protocol such as FTP or SFTP can be used to retrieve the file, as leaving it on the same machine would not provide good backup protection.

A special directory has to be created on the web server before saving an export file on it. Usually, this is a sub-directory of the main phpMyAdmin directory. We will use save_dir as an example. This directory must have the correct permissions. First, the web server must have write permissions for this directory. Also, if the web server's PHP component is running on safe mode, the owner of the phpMyAdmin scripts must be the same as that of save_dir.

On a Linux system, assuming that the web server is running as group apache, the following commands would do the trick:

# mkdir save_dir
# chgrp apache save_dir
# chmod g=rwx save_dir

Note

The proper ownership and permissions depends highly on the chosen web server and the SAPI (Server Application Programming Interface) (refer to http://en.wikipedia.org/wiki/Server_Application_Programming_Interface) used, which influences how directories and files are created and accessed. PHP could be using the scripts' owner as the accessing user, or the web server's user/group itself.

We also have to define the'./save_dir' directory name in $cfg['SaveDir'].We are using a path relative to the phpMyAdmin directory here, but an absolute path would work just as well.

The Output section will appear with a new Save on server... section:

Saving the export file on the server

After clicking on Go, we will get a confirmation message or an error message (if the web server does not have the required permissions to save the file).

Note

For saving a file again using the same file name, check the Overwrite existing file(s) box.

User-specific save directories

We can use the special string, %u, in the $cfg['SaveDir'] parameter. This string will be replaced by the logged-in username. For example, as shown in the following line of code:

$cfg['SaveDir'] = './save_dir/%u';

This would give us an on-screen choice, Save on server in the directory ./save_dir/marc/. These directories (one per potential user) must exist and must bear the proper permissions, as already seen in the previous section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.120.136