D
D
DeniSidorenko2020-03-29 07:48:35
Yii
DeniSidorenko, 2020-03-29 07:48:35

Why does php give this error?

Good afternoon, there is a simple medo

public static function exists($name){

    if(isset($_SESSION[$name])){
      return true;
    }

  }

Why is it throwing this error
Illegal offset type in isset or empty in ... Session.php on line 12

Line 12 - this is He swears at Checking $_Session[$name], and if you check only name, then everything is OK if(isset($_SESSION[$name])){

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-09-12
@Maxim86

Option
1 1. Move the uploads folder either to the root of the project so that it is /uploads
2. Set up the htaccess file so that uploads can be read and all links with this beginning go to this folder.
3. Create a link /uploads/....
1. Move the folder to frontend/web/uploads
2. Make sure that htaccess is allowed to read and write. (It is allowed in standard usage). In the standard htaccess configuration, all requests are sent to the web folder. Therefore, there is no need to configure anything further.
3. Form the link /uploads/....
You have a problem in two points:
1. htaccess is not configured or not configured correctly
2. You do not specify the link correctly.
I recommend using the second option if you want to quickly deal with the error. The first option is a little more complicated and it is more for the future allocation of files to a separate server or domain, like the frontend, backend folders

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question