Whenever I try to upload a file to import into phpMyAdmin I get the following error:

File could not be read

phpMyAdmin is the only php script I am running on my server, and as such my php configuration file is fairly vanilla except for the following changes:

upload_tmp_dir = /tmp
upload_max_filesize = 10M
post_max_size = 50M
memory_limit = 64M

The file I am trying to import is 4MB, well within the 10MB upload size and 50MB post size (it is also UTF-8). Setting upload_tmp_dir actually fixed a previous problem I was having (where phpMyAdmin was complaining that I didn't even specify a file) or at least made the error change to what I am getting now. The permissions on /tmp are 777.

What could the problem be? The file comes from a cpanel installation at hostmonster I am migrating away from onto my own vps. I have tried getting the sql file from the cpanel backup utility and from their installation of phpMyAdmin (both uncompressed and gzipped). I do not believe that the files are corrupted.

Extra information: I am running CentOS 5.6, phpMyAdmin 3.4.2, mysql 5.1.52, and php 5.2.16.

link|improve this question

Are the web server error logs showing anything that could give you more of a clue as to what is going on? – Bart B Jun 10 '11 at 12:59
Just to make sure I set the log to a new file and tried the upload. The only entries in the new file pertain to my self signed ssl certificate. The SSL is actually something I added in after I was already getting this error. – KPthunder Jun 10 '11 at 13:22
feedback

1 Answer

up vote 1 down vote accepted

If open_basedir is set in your php.ini PHP will not be able access files above that directory.

link|improve this answer
Aha! I had open_basedir set to /var/www/vhosts. I changed it to /var/www and set up a temp directory there. – KPthunder Jun 10 '11 at 17:30
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.