CakePHP tutorial: URL not found

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

CakePHP tutorial: URL not found

Postby vermoos » Tue Nov 22, 2011 3:11 pm

Hello,

I am following the CakePHP tutorial by Graham Weldon (LXF139).

The root document ~/localhost/library/index.php says

Your tmp directory is writable.
Your database configuration file is present.
Cake is able to connect to the database.

I have edited ~/config/database.php, the password is set and the mysql server is running fine.

After baking the models, controllers and views, when I go to ~/localhost/library/users I get

"NOT FOUND"
"The requested URL /library/users was not found on this server."

It should display "an empty list and some actions down the side."

When I go to ~/localhost/views/users, the directory *contents* are displayed in list form - not what the tutorial intends, I assume, unless ~/localhost/users is a typo.

Other pages like ~/webroot/test.php are found and displayed correctly so the site is picking up php pages on the FS, just not the ones I am expecting it to... is this because the MVC workflow has not kicked in, or is it a problem with the URI?

Any ideas how I can establish what the problem is (with my limited php knowledge) - I don't think it is the database (?)

with thanks

Mic
vermoos
 
Posts: 4
Joined: Tue Nov 22, 2011 2:29 pm

UPdate:

Postby vermoos » Thu Nov 24, 2011 2:03 pm

The URL NOT FOUND problem has changed into another problem.

I compiled apache with the --enable-rewrite option and reinstalled apache and php.

Now I get the green bars at the page
" Sweet, "Library" got Baked by CakePHP! "
(this did not happen without --enable-rewrite).

phpinfo() displays in webroot, but not in any directory below:
Missing Controller
Error: Testpage.phpController could not be found.

The phpinfo() script worked fine in all directories prior to reinstalling apache.

The "missing controller" must be due to the way the server locates files.

Or is there a config setting I need to change?

Hmmm...
vermoos
 
Posts: 4
Joined: Tue Nov 22, 2011 2:29 pm

UPDATE 2

Postby vermoos » Fri Nov 25, 2011 11:24 am

phpinfo() displays in the DocumentRoot and in any *empty* folder beneath but..

after: "cake bake project TEST"

phpinfo() does *not* display in the TEST directory

The "Missing Controller" error is not removed by baking the models, views and controllers.
vermoos
 
Posts: 4
Joined: Tue Nov 22, 2011 2:29 pm

SOLVED (sort of)

Postby vermoos » Mon Nov 28, 2011 5:17 pm

To save anyone the bother: all of the above problems are solved by using cakephp-instaweb

http://chris-lamb.co.uk/projects/cakephp-instaweb/
vermoos
 
Posts: 4
Joined: Tue Nov 22, 2011 2:29 pm


Return to Programming

Who is online

Users browsing this forum: Google [Bot] and 0 guests