CS50 course materials will tell you that the permissions need to be set as follows:
chmod 711 for directories
chmod 600 for PHP files.
In general, this is the correct advice.
However, if you have run update50 recently, you should know that there is a bug requiring chmod 640 instead for PHP files.
I've posted this ...
Apologies for the inconvenience! Should be fixed ASAP! But until it's fixed, yet another solution to this is to execute:
$ echo "#includedir /etc/sudoers.d" | sudo tee -a /etc/sudoers
in a terminal tab, and restarting all terminal sessions, by right-clicking inside a terminal and choosing Restart All Terminal Sessions. Then, try executing the apache50 ...
UPDATE 24-Dec-2016: As of IDE version 94, this has been fixed.
Suspect some cloud9 change. For the "more comfortable", a patch is needed in apache50 script. You need elevated permissions. (I used sudo vi /usr/bin/apache50)
change line 21 in /usr/bin/apache50 from
apache="sudo -S -u www-data service apache2"
apache="sudo sudo -S -u www-data service ...
The root cause is a Cloud9 change, github bug to track here: https://github.com/cs50/ide50/issues/27
DinoCoderSaurus's workaround should work until they update the cs50 ide.
Also: you should learn to use vi!
Simple steps for this case:
$ sudo vi /usr/bin/apache50
press 'i' to enter Insert mode
make your changes (using the arrow keys to navigate)
The bug is in the declaration of the flask function in /etc/profile.d/ide50.sh in IDE version 88. Since CS50x (edX 2016 version of CS50) does not use python, and flask is a python framework, you should be able to remove the function, start apache50, and roll merrily along. I tested on my system and was able to run pset6, pset7 and pset8.
Here is a way to ...
This guy had a solution. Not sure how good it is in security aspects though.
find . -type d | xargs chmod 711
find . -name *.php | xargs chmod 640
chmod 640 config.json
find . -name *.js | xargs chmod 644
chmod 644 public/css/*
chmod 644 public/...
There is a way to reset the IDE without fixing the PHP interpreter.
You can create a new workspace. Go to https://cs50.io/sharmapranjal and click on the big gray square that says "+ Create a new workspace".
In the screen that follows, you will be prompted to "Choose a template ..."
Be sure to select the last one in the list: "Harvard's CS50".
Then start ...
THIS IS MORE A COMMENT THAN AN ANSWER BUT I DON'T HAVE SPACE IN A COMMENT TO SAY ALL THIS
I looked at the three files mentioned on the error:
Let us call them apache2, ide50.sh, and envvars for simplicity.
I have no idea what the 71 is. Because apache2's 71st line has nothing and ide50.sh ...
First of all, let's look at the error message from the Apache2 logs:
(13)Permission denied: [client 10.240.1.18:34742] AH00035: access to / denied (filesystem path '/home/ubuntu/workspace/pset7/public') because search permissions are missing on a component of the path
What this means is that one or more of the parent directories on your full path to the ...