Issues moving Codigniter from Windows server to Linux based server |
I have moved a CodeIgniter based site from a Windows based server to a Linux based server. I have had various issues. Currently I am stuck on images failing to upload. (server timeout error - about 3 seconds after upload finishes)
Steps taken: Set uploads folder to 777. Try php 5.4 & 5.2. I was looking for a suspected temp folder somewhere, but not finding one. I have searched, and found an article discussing CodeIgniter timing out after 300s. But in my case, it times out almost immediately upload is initiated. File attempting to upload is 41kb. I have checked php settings, max_input_time: 60, upload_max_filesize: 64M, post_max_size: 64M Base url & path changed: must be right, the whole site works except for uploading images in admin area.
Garry Cross, Web Design, Hosting & Domains
Garry Cross Personal Computers (GXPC)
After much searching, it appears it might most likely be an Ajax issue. The file uploader appears to be ajax, and there are known issues with CI and Ajax and session errors.
I found some log files. They do correspond to what I did on the website. The first line is the last line displaying action of refreshing web page and time taken. The following lines are for click on browse for image and click upload. Code: DEBUG - 2015-06-10 01:58:43 --> Total execution time: 0.0495
Garry Cross, Web Design, Hosting & Domains
Garry Cross Personal Computers (GXPC)
This might sound like a stupid question, but do the directories you are uploading to actually exist? If you are trying to upload to a child directory that doesn't exist, you'd have to use mkdir first.
I've worked a lot with CI and ajax uploaders, and not had any problems related to sessions. I think blaming sessions is common, but you could remove the need for a session, and then does you uploader then start working? Probably not. Does the ajax uploader you are working with provide any debugging info sent to console? What uploader is it? Just for kicks, you could try out the uploader that is demonstrated in Community Auth. It definitely works, and I'm using it on a production website where thousands of files have been uploaded using it. No session problems. Windows, Linux, Mac ... no problems. Windows server, Linux server ... no problems.
If you are using relative paths, try to use abolute. If you are using absolute, try to use relative paths.
The directories do exist. There are images in them which display on the site.
NO idea if it has debugging. After some searching, came up with http://dojotoolkit.org/ How would I try without session? After what you said, and my experience with these sites, I am guessing it could also be a missing capital letter at a start of a file. I spent hours combing through files to get the site working when I first moved it from the windows server. There are a mixture of capitalised and uncapitalised files right through the site.
Garry Cross, Web Design, Hosting & Domains
Garry Cross Personal Computers (GXPC)
It would be great if I could find someone who knew CI that was trustworthy. I tried Freelancer for a few jobs-it wasn't worth it.
I had one job quoted at US$1000 just to start, I fixed it in 15 minutes. I am in a bit of a dilemna, I have a customer who wants their site working, and obviously doesn't want to pay for something which they didn't do. I have also a wholesale hosting provider which has dumped server changes on me making a heap of sites need repairs. This is why I am leaving them and moving my sites. Unfortunately the guy who built the site was very loose with coding which doesn't help.
Garry Cross, Web Design, Hosting & Domains
Garry Cross Personal Computers (GXPC)
also, make sure you don't have CSRF enabled, or, if you do, make sure it's done correctly.
after a few seconds... Oups... sorry, missed the fact that you said it worked on windows... Website: http://avenir.ro
When something worked on Windows and started failing when it was moved to Linux, you're going to be looking at a few specific things, but likely won't need to change any code (with one exception):
I set this up on my windows laptop running EasyPHP. Site runs as it should there also, but gets same timeout.
I contacted my wholesale hosting, and they said there was missing files. Errors below. 12:14:14 access("application/libraries/MY_Encrypt.php", F_OK) = -1 ENOENT (No such file or directory) 12:14:14 access("application/third_party/libraries/Encrypt.php", F_OK) = -1 ENOENT (No such file or directory) 12:14:14 access("application/libraries/Encrypt.php", F_OK) = -1 ENOENT (No such file or directory) These are supposed to be missing files, but are not in the original source files. And are not in any backups. I cannot find any other configuration settings anywhere. Dojo appears to be the ajax uploader used.
Garry Cross, Web Design, Hosting & Domains
Garry Cross Personal Computers (GXPC)
06-10-2015, 05:05 PM
(This post was last modified: 06-10-2015, 05:31 PM by gazzari. Edit Reason: More info )
I added the 3 missings files as empty php files and got an error, "Non-existent class: Encrypt"
system/libraries/Encrypt.php exists, but the other 3 do not. I had a look in an archived zip: CodeIgniter_2.1.3.zip The 3 files application/libraries/MY_Encrypt.php <sort of expected this not to be there application/libraries/Encrypt.php <I expected this ti be in the zip file application/third_party/libraries/Encrypt.php <I imagine this is probably a copy of the 1 above Where would I get these files?
Garry Cross, Web Design, Hosting & Domains
Garry Cross Personal Computers (GXPC) |
Welcome Guest, Not a member yet? Register Sign In |