I am getting mad trying to achieve something that is supposed to be very simple. First of all, I have the following upload form that works flawlessly under OS X + XAMPP. When moving this script to WAMP + Windows Server, I get serious problems during the file upload. I am using Codeigniter.
public function importExcel () {
$config['upload_path'] = 'upload/';
$config['allowed_types'] = 'xls';
$config['max_size'] = '0';
$config['overwrite'] = FALSE;
$this->load->library('upload', $config);
if (!($this->upload->do_upload())) {
echo $this->upload->display_errors();
}
$upload_data = $this->upload->data();
$data['filename'] = $upload_data['file_name'];
}
This is my simple function. The upload folder is located under www/mywebsite/. Codeigniter's config.php file is configured correctly.
When I try to upload a xls file, the server crashes (interrupting its connection). Meaning that I get this page with error: ERR_CONNECTION_RESET, instead of showing me the upload errors.
Here is what I can say:
- The file is not uploaded and I cannot find it in the upload folder.
- The file upload actually starts, I see in the bar below the browser window that it is loading the file. When it comes to 100% percentage, I get the page linked above.
Here is what I have tried:
- Changing the upload folder to /upload/, ./upload/ and stuff. When I tried to do ../upload/, i get the error and the page doesn't crash. It says he cannot find the right folder. This means that the folder is found during the upload and the problem is somewhere else.
- Adding the xls MIME type to .htaccess.
Here is my actual .htaccess file in case it could be necessary.
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
RewriteBase /websitefolder/
I repeat that this same code works good under OS X + XAMPP with the same directory structure.
EDIT: forgot to say I tried to upload xls of any kind and any size, even very little. This has nothing to do with upload limit probably, I already raised up the variables.
EDIT 2: my PHP error log is totally empty. These are the rows that get added to my Apace error log when I try the upload.
[Tue May 27 14:22:54 2014] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue May 27 14:22:56 2014] [notice] Apache/2.2.21 (Win64) mod_ssl/2.2.21 OpenSSL/1.0.0d PHP/5.3.8 configured -- resuming normal operations
[Tue May 27 14:22:56 2014] [notice] Server built: Sep 24 2011 19:57:51
[Tue May 27 14:22:56 2014] [notice] Parent: Created child process 4736
[Tue May 27 14:22:56 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue May 27 14:22:56 2014] [notice] Child 4736: Child process is running
[Tue May 27 14:22:56 2014] [notice] Child 4736: Acquired the start mutex.
[Tue May 27 14:22:56 2014] [notice] Child 4736: Starting 64 worker threads.
[Tue May 27 14:22:56 2014] [notice] Child 4736: Starting thread to listen on port 80.
[Tue May 27 14:22:56 2014] [notice] Child 4736: Starting thread to listen on port 80.
EDIT 3: tested a non-with-Codeigniter file upload by using w3schools sample code. I get:
Upload: test.php
Type: application/octet-stream
Size: 26.90234375 kB
Stored in: C:\Wamp\tmp\phpAAB5.tmp
But when I go in C:\Wamp\tmp I cannot see the file. There are other temporary files of the same kind however. By using the code under Saving the Uploaded File the upload works correctly and I CAN find the file I uploaded.
I am desperate because I need this for a client. Any help? Thank you.