I loaded my codeigniter site onto my actual webserver (instead of just local). I am getting a 404 page not found even from the root domain. On my localhost it works fine.
Try going to searchnwork.com and it gives the Codeigniter 404. How can I start debugging this and seeing what page CodeIgniter thinks it's loading?
Go to config file and check the base_url setting
or add this
$config['base_url']='http://searchnwork.com';
Look into /application/logs/ folder (this catalog must be writable to logs could be written). Check if you have model and controllers names in lowercase - it's common problem especially if you've moved site from Windows server.
do you have access to the PHP log and Apache log - check if its firing errors on both ends.
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 a Laravel 5.2 project working fine locally, after uploading to a live server I have a 'laravel' folder in my root directory and public folder under 'public_html/testsite'
My 'index.php' points to the correct '/bootstrap/autoload.php' and '/bootstrap/app.php'
Upon going to my 'url/testsite/' I get a blank page only (was working fine L5.0) firebug shows : 500 Internal Server Error with HTML : Reload the page to get source for...
index.php is loading by testing with die() before any 'require' methods, but after 'require... autoload.php' the die() is not working, however it is successfully calling autoload.php as a die() works within this file.
I'm not sure if this is a .htaccess issue, or maybe I had to set something up in cPanel last time for this folder (I can't remember). I'd appreciate any help!
Please note this Laravel project sits as a test site in a /testsite/ folder along with my current live site files.
Amongst changing many things at once, I appeared to have solved this by setting up a subdomain within cPanel and setting this to my testsite/ folder.
This was on a server with my current website live under public_html/ and setting up a test laravel app(website) with under public_html/testsite/ to work as an independent site for testing.
The typical "change permissions on storage folder" suggested elsewhere on stackoverflow did not solve my issue so hopefully this helps someone in the same boat.
After extensive search, double checking install, reinstalling, troubleshooting, I don't know where to turn next.
Background:
I'm trying to get a wiki working using MediaWiki.
I have PHP Manager installed for IIS 7.
I have a MySQL server installed on the same machine.
PHP version is 5.6.5 and installed at C:\PHP.
The main issue:
Locally I can view the index.php file, but not externally.
I get a generic page can't be displayed error if linking to the /w/ directory.
Depending on the browser I'll get two results when linking to w/index.php:
page can't be displayed
IIS 404.0 Error.
Depending on the browser I'll get two results linking to w/index.php?title=Main_Page;
IIS 404.0 Error
unformatted page content
The error:
Module: IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code: 0x80070002
Requested URL: http://localhost:80/w/index.php?title=Main_Page
Physical Path: C:\inetpub\wwwroot\w\index.php
Logon Method: Anonymous
Logon User: Anonymous
Troubleshooting done:
No errors shown by PHP Manager.
Switched PHP versions (no effect).
Externally tested other PHP forms running inside HTML (works fine).
Checked permissions on all folders (fine).
Edited Feature Permissions under Handler Mappings to allow executable (no change).
Changed PHP_via_FastCGI's access restriction to execute (no change).
Checked to make sure PHP Handling Mapping was set to *.php (it is).
Checked Default Document settings and index.php. Externally tested index.html in w/ (works both by direct link to file and link to folder).
Externally tried tested /w/index.html with PHP "Hello World" inside it (blank page).
What am I doing wrong? Everything works perfectly fine run locally on the server.
As Christpher says, localhost is a wrong in an URL to be contacted from outside: if that's what you see, you forgot to set $wgServer correctly.
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.
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.