Fatal error: Using $this when not in object context in PHP

Whenever you got this error check the following:

1. Make sure the $this-> is used inside the object and referring to the class’s and inherited non-static members.

2. Make sure the called members of the object are properly addressed as static or member/function variables

Do you know the different different post types?

Here is an example for the second one.

Assume you have the following object


class Example
{
   function getExampleText()
   {
      return "Example Text";
   }
   static function getStaticExampleText()
   {
      return "Static Example Text";
   }
}

While accessing, if the code tries something like this one,

$example = new Example();
Example::getExampleText(); //Trying to access non-static as static

Then you would have the error

403 Forbidden You don’t have permission to access .. on windows pc

You don’t have permission to access error

I was trying to access my PHP web project from my Vista on my Ubunut and end up running error 403 Forbidden You don’t have permission to access on this server …

Do you know how to find missing numbers from billing records – algorithm

Well this has a very easy remedy:

BTW – I am using Uniserver – http://www.uniformserver.com/ – [ Which is the coolest development environment on windows as you would get PHP, MySQL, and PhpMyAdmin residing all at one place.]

But it doesn’t matter if you are using other tool.

1. Go to where your www folder

2. open .htaccess file using your favorite text editor – note pad is more than enough for this.

3. Under Allow From 127.0.0.1 – or whatever it is allowed Add Allow From [your ip address of the computer from which you want to access the server]

Get started with nodejs and angularJS with this tutorial

How to configure php mysql and apache