PHP MySQL novice to ninja 6th edition

I don’t know if anybody here have read the 6th edition of the book but there is an error in the mini framework the author Kevin yank created and I have messaged him on twitter on several occasions to help us fix the bug as I have tried every possible means to fix it but with no success but he hasn’t reply my message for now. I don’t know if anybody have been able to fix the bug should please share us how he did it and if nobody has done it, can someone help us inform sitepoint to help us out. Thank you all

Hi there @oluwa. The principal author of the 6th edition is @TomB. I’m sure he’ll be along before too long to help you out… :smile:

I will really appreciate it if he can help us out

Might be an idea to post a bit more information ready, such as the code that this bug appears in, what the problem with it is, and s on.

Hi oluwa,

Without more information about the problem you are having, I’m afraid I can’t offer any advice.

Even trying with the final project I downloaded on github. This is what it is displaying…

Notice : Undefined index: public/index in C:\xampp\htdocs\phpmysql6-Final-Website\classes\Ninja\EntryPoint.php on line 45

Notice : Undefined index: public/index in C:\xampp\htdocs\phpmysql6-Final-Website\classes\Ninja\EntryPoint.php on line 46

Fatal error : Uncaught Error: Method name must be a string in C:\xampp\htdocs\phpmysql6-Final-Website\classes\Ninja\EntryPoint.php:47 Stack trace: #0 C:\xampp\htdocs\phpmysql6-Final-Website\public\index.php(8): Ninja\EntryPoint->run() #1 {main} thrown in C:\xampp\htdocs\phpmysql6-Final-Website\classes\Ninja\EntryPoint.php on line 47

That is the error it is displaying

Your routes need to exactly match your URLs. The public directory should be the directory that is web accessible. Move everything one level up.

Ok. I will try that. But as you can see, It is untouched, as I downloaded it from github and extract it to XAMPP, I just tried it out.

Is it just the index.php out of the public directory?

Everything needs to be moved up one level. Whatever is in public needs to be at the level you have the public directory in, everything else needs to be the level above that.

It means I have to move the ijdb directory and the Niinja directory out of the classes directory

Move the whole classes directory up one level. Everything needs to be one level up and you may need to rename public to httpdocs, htdocs or whatever it is configured as.

everything is one level up already

The error suggests that you are visiting localhost/public/index or similar, you should not have public as part of the URL

Sir, I will suggest you try it on windows. But I will use php7 inbuilt server

I don’t have a windows box to test with but if you are getting that error your URLs contain /public/ and they shouldn’t

Alternatively, use the vagrant box as suggested in the book.

Make sure everything is the level above your htdocs directory and then put everything from public in htdocs then create the .htaccess file.Htdocs shout not contain anything else.

I will try it on a live server(I believe the server is running on ubuntu

Make sure you follow my instructions above, the process is the same on both windows and Linux.