I have just moved my CodeIgniter project to a new server and now I'm getting a 500 error and no output from the project. It works fine on my old server and in my test environment. I'm completely stumped how to troubleshoot this, especially as there's nothing of use in the log files. Any help would be great!
Well, this is embarrassing. I was missing php-mysql. CodeIgniter wasn't logging the fact that it couldn't find it, nothing was appearing in /var/log/messages. Installed it and suddenly, it works. Thanks all for your answers.
I get this problem on my live server with SuPHP. To avoid it, all PHP files must have permissions 0644, and directories 0755.
To do this without a headache, do one of the following:
Get an FTP client that will upload using permissions you specify
Find a PHP script that will change permissions, based on filtering criteria, after upload
Get shell access to your host!
Some ideas for you:
Are you sure there is nothing in the log files? Have you checked both the web server's log files as well as the system logs (EG: /var/log/messages)? Have you checked all of the logs enabled in php.ini?
Double-check your CI configuration settings. Perhaps you are pointing to the wrong database?
Have you confirmed that a basic PHP script <?phpinfo(); ?> works? This would isolate the problem to CI
Most likely you have not specified the base url for the new location, you can set it from file:
/system/config/config.php
at line:
$config['base_url'] = 'your new url here';
have you try load a new CodeIgniter project, and try to load in ur test environment? is it work?
From my experiment 500 error normally due with web server problem. But from what your said you didn't have any .htaccess. You better try just load a clean CI project and see your webserver OK or not.
Related
I have recently moved one website to new server. I have transferred everything properly including mysql database. But now the internal pages are not opening (sending 404 error). Homepage looks fine.
One thing to consider here is that, the website was on shared cpanel with another domain and residing in a folder. Now after moving, it is placed directly in public_html. I hope, this doesn't create any issue.
The website is: http://nepaltrekking.co.kr/
regards,
When hosting changes, we need to take care of the following steps for codeigniter:
Check required php and apache modules are installed and enabled.
If installation is not in root directory, you must change htaccess.
If domain is changed, you need to edit config file for new base_url.
Clear application cache if enabled. Give required write permision in cache directory.
If nothing works, then see error log and correct error accordingly.
Actually I resolved it. The issue was with .htaccess. I changed the permission to 666 and it started working. I think there was problem writing in the .htaccess file.
I have been asked to move a silverlight site from one host to another. I have been told that this is easy, but its not working. I was given a zip of all the files, and the database and instructions on adding a couple of mime types. We created teh db/user as per the config file.
The original site is still live, so that's good. However, all we get on the new site is 'forbidden' at every level except the root which shows (an incomplete) list.
We are 90% sure the db is set up correctly and the mime types too.
We notice that the config file is down inside www/mysite and is called _config.php - is this ok?
I am guessing that we have missed something very obvious. Any ideas please?
It's a newby suggestion, but maybe you forgot to reset the file permissions? Try sudo chmod 700
If that doesn't solve the issue, then please give the complete error.
I got the same problem after publish my Silverlight application. In my case, there was not set default document on web.config, or you can just config in IIS.
i have set up my symfony 2.3 project with xampp correctly as I had access the app_dev.php successfully. However, i can not access it and other files like config.php now!! I really have no idea what was going wrong, when I clicked on the web/ or type /path/to/web/app_dev.php all browsers are just keep loading, not even return errors.
p.s. preparations like "php app/check.php" has been done, and /web/config.php was also fine before I met this problem.
Please give some hints and I appreciate all! Thx..
Please check for file permissions and turn on your error logger. Turn on display_errors and try it once again.
Possible reasons are
- Permission to write in cache and log
- Your symbolic links is not pointing properly to web
- Config file is not configured with ORM etc..
All these should come as error file and will be shown on the screen
I have website where I can login , trying to edit the records .. as soon as it displays like this,
Forbidden
You don't have permission to access /backoffice/processfaculty.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I am trying to save data from fckeditor and i don't have any htaccess file on the root ... i also checked permission (755 , tried 777)...
If I edit and save with simple texts , it works fine.. but if i do it with fckeditor data, it does not.
Please check you server configuration, you need to have PHP enabled on your server. Look into the error log of your server it will have more information.
This looks like you have a web-firewall installed on your webserver. Temporarily disable it to test if it is causing the issue.
Here is what i think you should look into:
what is the mask value?
umask();
The umask() function changes the file permissions for files.
Oooops I did it again.
My site worked perfectly locally
My development machine is a windows WAMP2 setup
My server is a CentOS 5.5 APACHE 2.2 PHP5 seup
I'm getting a 404 on the codeigniter site that I've deployed, and I really can't make out what's wrong, so please help me find the error.
It's the root url. I haven't set up dns so it's just the ip address of the server. It was showing the standard apache page before I uploaded codeigniter. I've looked over the config file, and it looks ok. Could it be a file permissions error? i have set chmod o+rw in the whole /var/www/html dir. the error_log in the httpd shows nothing
I've tried testing if it was the mod_rewrite module, but I created a test directory with a .htaccess file with RewriteEngine ON that didn't give me an error, so that can't be it.
In codeigniter I've set the log_threshold to 4 in the config, but I don't get any log messages, so I can't really make out if it's a pre-> codeigniter error, but I really don't think it is, as it's loading my Error view, still Why isn't there any log being written, what's it about?
Any help would be extremely appreciated as I'm running on fumes to get this working...
Update
Thanks to #jondavidjohn I have discovered that hitting the controller directly IE:
http://addr/index.php/GeoController/markers/
Will provide me with a controller specific error saying:
unable to locate your model "modelname"
SOLVED
Thanks to #jondavidjohn, and #timdream for giving me the clues to solve this one. It was a naming problem, I had filenames that were camelcased, and they can only be small from what I understand now, so the ROUTE was innefective in that it lead to Site, but should've lead to site although I had a Site.php I had to change it and the route to site.php
make sure you have the correct settings in system/application/config/config.php.. pay special attention to
$config['base_url'] = "http://www.example.com";
Make sure you are putting in the root domain of your site, also check your routing config and make sure you have the correct default controller set in system/application/config/routes.php
I recently started using a fresh install of codeignitor 3.0 and had no problems on my dev server (Windows) then when I moved to my live server (Linux) I started getting a 404 error.
The reason for this is that in 3.0 you are meant to capitalise the first letter of your controllers/models and also the file name.
e.g.
class Test_model extends CI_Model {
Test_model.php
Hope this helps some people who end up here!
For reference:
http://www.codeigniter.com/userguide3/installation/upgrade_300.html
$config['uri_protocol'] could also play a part. It's default to AUTO, which looks for environment variable that contains the actual URL automatically.
I had a web app that fails when I switch to php-cgi from mod_php for my server. Changing the config to REQUEST_URI solves the issue. I found the valve by digging phpinfo() outputs, you could try to do that.
My first bet is that you were developing this and modified the .htaccess file.
HOWEVER, if you went from a Windows -> Linux system change (dev on Win, prod on nix) then you have to keep the Controller names in mind, if a file on windows was "Home.php", and you used "home.php" in the config as your default route, then it will fail.. as there is no "home.php" file.
Home.php != home.php
Linux is case sensitive. Check that out, it might be a simple thing but could cause snags.
Again I am just guessing due to lack of details.