Possible permission issue

Asked

Viewed 59 times

0

While trying to run a php code on my Ubuntu machine

if ( ! is_dir($system_path))
{
    header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
    echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
    exit(3); // EXIT_CONFIG
}

He is showing error:

I realize it may be permission error my machine, I have tried following this tutorial: http://fideloper.com/user-group-permissions-chmod-apache

But when executing second command: $ chmod go+x /var/www my Ubuntu presents the following error message:

chmod: alterando permissões de “/var/www”: Operação não permitida

Any hint of what might be?

  • You have already given read permission to all group directories www-data: sudo chown www-data:www-data -R *. And then he added his user to the root.www-data group something like sudo chown seu_user.www-data ?

  • to modify system directory permissions you must execute the command as root, utilize sudo chmod ...

  • @Ivanferrer My user was already in the www-data group, but had not yet run the command to give read permission to all directories of the www-data group. Even running now, it didn’t solve.

  • @Sanction, yes I already execute the commands with sudo... thanks

  • With print_r($system_path); die(); what appears on the page?

  • tried: 'sudo chmod 775 -R /var/www' ? to change permissions you must enter sudo

  • Do sudo chmod 0755 /var/www, must be sufficient.

Show 2 more comments

1 answer

-1

If you are the machine’s admin

sudo chmod go+x /var/www

He’ll ask you for Pw and he’ll do it later.

  • 1

    I executed this command, nothing, it still fails to get the necessary permission.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.