According to this post on the CS50 Reddit, the permissions necessary for Problem Set 7 (CS50 Finance) and Problem Set 8 (Mashup) have changed since version 59 of
ide50 , and the problem specification and documentation have not been updated to reflect the new permissions.
Posted by2 years ago
Archived
In my experience, you'll need a minimum of
chmod 711 for directories, chmod 640 for PHP files and config.json , and chmod 644 for HTML, CSS, JavaScript, images and font files. Rise of nations game.
However, I have noticed that a lot of people on Stack Exchange and Reddit have been advising that the solution is to use
chmod -R 777 * to remove all permission protections entirely.
I feel your pain! Permission errors can be really frustrating. You are impatient to get back to work, and in your haste, you reach for
chmod -R 777 * , the biggest sledgehammer in your toolkit.
It probably feels like you have solved your problem, because the permission errors have gone away. Now you can get back to work!
But
chmod -R 777 * is never the right thing to do, despite all the bad advice on the Internet urging you to do it.
If you make a habit of 'solving' your permission issues this way, you may someday find that the PHP ZenCart instance you set up with sloppy permissions for your first business client has been hacked, and all of your client's customers have had their credit card info stolen.
This is a golden opportunity to learn how to do things the right way.
The next time you see a '403 Forbidden' error when you try to load a page, watch the Apache error log in the Terminal by executing the following command:
before reloading the page in the browser. You may find a more specific error message there.
Meanwhile, don't lose heart! This process of reading Apache logs and PHP error messages to help resolve permission errors or other issues is actually something you'll do all the time as a professional web developer, so think of it as valuable practice rather than a waste of time!
Here are some sensible default permissions for Problem Set 7 and Problem Set 8. Hopefully they'll be enough to get you started.
For Problem Set 7:
Open a Terminal tab in the IDE, and execute the following commands:
For Problem Set 8:
Open a Terminal tab in the IDE, and execute the following commands:
I think that should be sufficient. Please let me know whether or not it works!
Also, I've answered many similar questions in greater detail on Stack Exchange, so feel free to poke around in my Answer history for more info.
Here's a more detailed explanation, based on an answer I wrote elsewhere:
To resolve the issue, you can spend a long time tinkering around with individual permissions on files and directories, which probably sounds like a big waste of time.
Luckily, there is a better way. You can very rapidly use the Linux
find utility to find all the files that need changing:
Try it yourself! That's exciting, isn't it?
Note that the first command returns all the directories, and the second one returns all the PHP files.
But then we need to 'pipe' the output of that command to
xargs , which will execute a command using that output as its input.
In this example, we will list the permissions of all the PHP files:
Note that this trick doesn't work the same way with directories.
Think for a moment about what would happen if you executed
find . -type -d | xargs ls -l , or just try it for yourself.
It doesn't show you the permissions on the directory!
Instead, it shows the permissions for all the files and folders in the directory listing.
Luckily, it is easy to use the
find | xargs pipeline to set the permissions:
This version does work as expected, both with regular files and with directories.
Try that, and you will see how quick and easy it can be to resolve these permission issues in the future.
403 Forbidden Remote Server
Unfortunately, once you have used
chmod -R 777 * , it's not so easy to reverse the damage. Imagine that you have a magic wand that can make anything change color to a single color of your choosing. You can use your magic wand to turn a rainbow all red! But you cannot use the same wand to make it change back to 'rainbow' -- you can only make it all blue, or all yellow, or all green.
For Problem Set 7:
403 Forbidden Error
To restore your permissions to sensible defaults after using
chmod -R 777 * , the following commands may help:
Note: I have not tested these exact commands on my own
pset7 directory, because I have not used chmod -R 777 * on it, but I believe that they will help to repair the damage without causing trouble with the C$50 Finance website.
For Problem Set 8:
To restore your permissions to sensible defaults after using
chmod -R 777 * , the following commands may help:
Note: I have not tested these exact commands on my own
pset8 directory, because I have not used chmod -R 777 * on it, but I believe that they will help to repair the damage without causing trouble with the Mashup website.
33 comments
Categories
Arts & Humanities
Beauty & Style
Business & Finance
Cars & Transportation
Computers & Internet
Consumer Electronics
Education & Reference
Entertainment & Music
Family & Relationships
Food & Drink
Games & Recreation
Health
Home & Garden
Others
Politics & Government
Pregnancy & Parenting
Science & Mathematics
Society & Culture
Travel
Leader BoardWhat's this?
Compatible with Windows 10, 8, 7, Vista, XP and 2000
Optional Offer for WinThruster by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
Symptoms of Error 403
These 403 error messages can appear during program installation, while a Tonec Inc.-related software program (eg. Internet Download Manager) is running, during Windows startup or shutdown, or even during the installation of the Windows operating system. Keeping track of when and where your 403 error occurs is a critical piece of information in troubleshooting the problem.
Causes of Error 403
What Does 403 Forbidden Mean
Runtime Errors such as “Error 403” can be caused by a variety of factors, so it is important that you troubleshoot each of the possible causes to prevent it from recurring.
Runtime Errors Knowledgebase
Article ID:
124532
Article Author:
Last Updated:
Popularity:
star rating here
Optional Offer for WinThruster by Solvusoft EULA | Privacy Policy | Terms | Uninstall
Optional Offer for WinThruster by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
Below is a list of troubleshooting steps to resolve your Error 403 problems. These troubleshooting steps get progressively more difficult and time consuming, so we strongly recommend attempting them in ascending order to avoid unnecessary time and effort.
Please Note: Click the [ ] image to expand the troubleshooting instructions for each step below. You can also click the [ ] image to hide the instructions as you proceed through each step.
Optional Offer for WinThruster by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
Operating System Information
403 error messages can occur in any of the following Microsoft Windows operating systems:
Are You Still Experiencing Error 403 Issues?
Please reach out to us anytime on social media for more help:
Optional Offer for WinThruster by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
Recommendation:Scan your PC for computer errors.
Optional Offer for WinThruster by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
About The Author:Jay Geater is the President and CEO of Solvusoft Corporation, a global software company focused on providing innovative utility software. He is a lifelong computer geek and loves everything related to computers, software, and new technology.
Browse Errors in Alphabetical Order:
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |