Welcome Guest, Not a member yet? Register   Sign In
The requested URL was not found on this server.
#1

[eluser]chubbypama[/eluser]
just moved my codeigniter app from one machine to another.
i'm getting the above error message.

here's what I've checked so far:
config.php for code igniter has the following:
$config['base_url'] = 'http://localhost/myapp/';

when i navigate to http://localhost/myapp/, i don't get any error messages, and nothing is displayed /rendered. I do a view source and there is no html on the page. (btw. I have specified "welcome" as my default controller in routes)

when i navigate to http://localhost/myapp/welcome, I get the error The requested URL was not found on this server.

I checked my apache2 access log this is what it contains:
127.0.0.1 - - [14/Aug/2012:11:48:32 -0400] "GET /myapp/welcome HTTP/1.1" 404 502 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1

shouldn't it have "GET http://localhost/myapp/welcome" instead of just "myapp/welcome"?

also i tried looking up the 502 error message and fuond that it means:
The server was acting as a gateway or proxy and received an invalid response from the upstream server
but i'm not sure i understand how to troubleshoot.

The thing is other applications work. So i can do "http://localhost/phpmyadmin" and it works.
Also i created a test.php page in my "myapp" folder and it works too.
I'm just new to web development so sorry if my question is basic.

I'm not using .htaccess as far as i can tell. I have the following variables set in my config.php for codeigniter:

$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';

Thanks.
#2

[eluser]TWP Marketing[/eluser]
You need to include index.php in your url unless you have specifically set config and .htaccess to remove it.
Code:
http://localhost/myapp/index.php/welcome

However, your default "http://localhost/myapp" should still work, don't know why it fails
#3

[eluser]CroNiX[/eluser]
What is your base_url set to? Does it include the "myapp" directory as part of it? It looks like it should be 'http://localhost/myapp/'
#4

[eluser]chubbypama[/eluser]
[quote author="TWP Marketing" date="1344961767"]You need to include index.php in your url unless you have specifically set config and .htaccess to remove it.
Code:
http://localhost/myapp/index.php/welcome

However, your default "http://localhost/myapp" should still work, don't know why it fails[/quote]

I tried to include index.php in the URL but it still doesn't work. I don't get the error message, but nothing is displayed.
#5

[eluser]chubbypama[/eluser]
[quote author="CroNiX" date="1344963510"]What is your base_url set to? Does it include the "myapp" directory as part of it? It looks like it should be 'http://localhost/myapp/'[/quote]

Yes, my base_url has been set to http://localhost/myapp/.
#6

[eluser]chubbypama[/eluser]
I've also made sure that error messages are turned on in my php.ini file. IN part, this is what the ini file looks like:

Common Values:
; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
Default Value: E_ALL & ~E_NOTICE
Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
; Off = Do not display any errors
; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
; On or stdout = Display errors to STDOUT
Default Value: On
Development Value: On
Production Value: On
http://php.net/display-errors
display_errors = On

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. But, it's strongly recommended that you
; leave this setting off on production servers.
Default Value: On
Development Value: On
Production Value: On
http://php.net/display-startup-errors
display_startup_errors = On
#7

[eluser]CroNiX[/eluser]
Sorry, I didn't see that in the post the first time. Do you have error reporting turned on and have it set to display errors?

I'd also try the other uri_protocol settings.
#8

[eluser]CroNiX[/eluser]
Edit: You posted while I was responding. You need to set the error reporting in CI as well, as it overrides some of those settings, like display errors. Check in index.php, as well as your ENVIRONMENT settings.
#9

[eluser]chubbypama[/eluser]
[quote author="CroNiX" date="1344964166"]Edit: You posted while I was responding. You need to set the error reporting in CI as well, as it overrides some of those settings, like display errors. Check in index.php, as well as your ENVIRONMENT settings.[/quote]

Here's what i have in index.php (it is located in the main directory of my ci app)

*/
define('ENVIRONMENT', 'development');
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/

if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;

case 'testing':
case 'production':
error_reporting(0);
break;

default:
exit('The application environment is not set correctly.');
}
}
#10

[eluser]chubbypama[/eluser]
just fyi. since including index.php in my url, i don't get the error message anymore. BUt nothing displays.
Still getting blank pages, no matter which controller i use.




Theme © iAndrew 2016 - Forum software by © MyBB