Page not found error

Hey,

Tried to find a topic about it, but no luck!!

Can anyone tell me, why my installation doesn’t work? I nives it from one server to another, but it says page not found. I changed the db connection in the config/main file, but with no luck.

The site: www.traicosport.com

Can anyone help me, very important I Can get my site working again…!

Kind regards

Kemster

By the way, it is the traicosport.com/index.php to Call the yii framework… As you Can see, the error works, but not the normal page…

How can anybody help you when you did not give any information about your setup…

traicosport.com/index.php says file not found… so first thing would be to check if there is an index.php in the web root directory for that site…

traicosport.com/index.html works because there is an index.html page in that directory

Hey Mdomba,

Thanks for replying so quickly… Very appreciated!!

Well the answer is: I don’t want to spam the forum with loads of code, and I am a try-it-self-person, who gives up after trying now… I only use the html file, for keeping our users from beeing confused…

Yep, the index.php file is there, and I don’t think the yii framework error would work, if it wasn’t.

And here’s the setup:


<?php


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','/home/www/');


// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'Traicosport.com',

	'defaultController'=>'site',


	// preloading 'log' component

	'preload'=>array('log'),


	// autoloading model and component classes

	'import'=>array(

		'application.models.*',

		'application.components.*',

	),


	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']

	'params'=>require(dirname(__FILE__).'/params.php'),


	// application components

	'components'=>array(

		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

					'levels'=>'error, warning',

				),

			),

		),

		'user'=>array(

			// enable cookie-based authentication

			'allowAutoLogin'=>true,

			// force 403 HTTP error if authentication needed

			'loginUrl'=>null,

		),

		'db'=>array(

			'connectionString'=>'mysql:host=hostname;dbname=name',

			'class'=>'CDbConnection',

                        'username'=>'user',

                        'password'=>'passw',

                        'charset'=>'utf8'

		),

		'urlManager'=>array(

			'urlFormat'=>'path',

			'showScriptName' => false,

			'rules'=>array(

				'login'=>'sportsClub/login',			

				'sportsklubber'=>'sportsClub/list',

				'sportsklub/tilmeld' => 'sportsClub/create',

				'sportsklub/succes'=>'sportsClub/success',

				'sportsklub/<uri>'=>'sportsClub/show',

				'sportsfaciliteter'=>'sportsFacility/list',

				'sportsfacilitet/tilmeld' => 'sportsFacility/create',

				'sportsfacilitet/<uri>'=>'sportsFacility/show'

			),

		),

	),

);

it worked on the other server… Can a wrong database connection make the error? (eventhough I am 99,99% sure it’s right…)

What is the content of index.php?

Edit:

If you have disabled YII_DEBUG… try to enable it so to get a more descriptive error

The content I have tried to change with / and it gives me the php error, that it can’t find the files… So it must be correct as it is. Also tried to change the base_path in the config file, by removing …, but this gives an Yii error… Argh, hate when it is impossible to find the problem!

It looks like the debugger is active…


// change the following paths if necessary

$yii='framework/yii.php';

$config='protected/config/main.php';


// remove the following line when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);


require_once($yii);

Yii::createWebApplication($config)->run();

The main/first site is: protected/views/layouts/main.php is it possible, it can’t find or read this file?

I have read, that one of the problems with moving frameworks is the different PHP settings on the server, but what should be changed? The requirements/index.php only makes a problem about the Memcache, but couldn’t imagine that this could be the problem…?

Try with




$yii=dirname(__FILE__).'/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';



Yeah, that’s what I tried, but it makes the php error (you can see the result now)… It seems like it can’t find the first page… But why not?!

How about some session code or so, that is saved in a text og htaccess. file?

In worst case, I have to install a new version an try to integrete the old

Check the documentation for require_once() - http://php.net/manual/en/function.require-once.php

In one of the comments says to check open_basedir for this error…

Here is one similar problem - http://www.bigresource.com/Tracker/Track-php-w5es3qoG/

He solved it by using getcwd()

Well I get the same problem, it just finds the yii and config file via another path.

But I understand that you are certain about the problem must be found in one of these links/path relations…?

Have you checked the open_basedir value?

Hey again…

I have tried all of it. Also thought I had found the solution, but still not working. I uploaded a new version of yii, and everything works fine. Considering integration the old one into a new, but also a looot of work.

I put in a part of the original Error file and got this message:

I googled it, and told me, that it might have something to do with the URL manager. Can you see anything wrong in the above code?

Otherwise I have to give up, and tried to use the new version, and look forward to days of coding…

Hope you (or anyone else) have the time to look at it.

Only thing with “site” in the above code is ‘defaultController’=>‘site’ (That means that the default controller is SiteController.php)… why do you think the error is in the above code…

You wrote that everything works fine - what works fine?

And that you put part of the original Error file… what part?

[color="#000000"]

[/color]

Yes…:

  1. I uploaded and installed the 1.1.4 version of Yii in the root of the website: and it all works fine. I moved the older version with the problems to /1.3/ (http://www.traicosport.com/1.3/index.php)…

  2. I have implemented to old stuff to the newer version, and am almost there I think… The only problem lies in: that when I use “‘showScriptName’=>false,”, it goes wrong.

http://www.traicosport.com/index.php/sportsklubber - true works

http://www.traicosport.com/sportsklubber - false doesn’t

(The most important thing for me is to get my “list” and “show” to work, cause a lot of roots are in Google. And an amateur yii programmer like me, didn’t think it was a problem switching server…)

  1. This brings me to the conlusion that the server can’t find the right files via the URLmanager. But whyyyy… :blink:

  2. I took the error script from the views/system/error.php file:


<?php echo nl2br(CHtml::encode($data['message'])); ?>

For the

‘showScriptName’=>false

you need appropriate .htaccess - http://www.yiiframework.com/doc/guide/topics.url#hiding-x-20x

Mdomba, that’s great!! We did not resolve the original problem, but it works again, and I got a newer version as a bonus…

Can I give you some points or so?

At least something is working…

so what is the original problem? there is no more "page not found" as I see…