Composer classes are loading but my local classes aren't loading

I am building a aplication with Yii2 framework but I am experiencing a problem I have never seen in PHP.

If I try load any local classes that I have created I get this error “maximum execution time of 125 seconds exceeded”.

I have tried increasing script execution time nothing, I have tried increasing memory nothing.

Everything was working find and suddenly this issue stated.

This problem of why only composer classes are being loaded and my local classes won’t is bigger than me.

If anyone is familiar with this problem and have a solution I would greatly appreciate any help I can get.

Hi @Million ,

Could you tell us some details about your “local classes”?
Where are they located, and what do you do to “load” them?

And we usually get “maximum execution time” error when we have some dead loop somewhere in our code. It is not a problem of loading and is probably a coding error.
Don’t you have some suspicous code changes before this problem begins to happen?

Sorry the late reply and thanks for your response. I tore all my hair hair out but i did fix the issue. It turns out i was instantiating my classes in the __constuctor so i could use them globally throughout the class.

PHP or Yii2 doesn’t like this so the script would just run until it max out without doing anything.

I remove the class instantiations from the __constructor and everything is working fine.

I don’t why i got this reaction you got any idea bro?

Does your class extend some Yii2 class?
If so, __construct() of your class should follow the instruction stated in the API doc of yii\base\BaseObject.

Well they do extends Yii2 Model, it’s been a while I haven’t look at the docs.