My system: Mac OS 10.11.6

Server version: Apache/2.4.18 (Unix) Server built: Feb 20 2016 20:03:19

Server version: 5.7.13 MySQL Community Server (GPL)

PHP Version 5.5.36

I am trying to test the whole pset7 outside of the cloud, but, being among less (much less) comfortable, I can't be sure I know which information in given files I shall change to make sure I get to CS50 page, i.e. run the cs50 finance page using my local AMP. I have changed config.json, and I have run all required in pset7 permissions:

chmod a+x ~/Sites/pset7/public
chmod a+x css fonts img js
chmod a+r css/* fonts/* img/* js/*

But I assume there are other important details that I have to change to be able to run the pset on my machine. When I try to access http://localhost/~username/pset7/public/login.php I get an error:


You don't have permission to access /~Alla/pset7/public/login.php on this server.
Server unable to read htaccess file, denying access to be safe

Thank you very much!

  • Just in case no one answers, you can always use CS50's virtual machine which has the server pre-configured. – ChrisG Aug 5 '16 at 8:28
  • @ChrisG Thank you! I hope to get answer on this - it's important to be able to test the pset on my machine ) – Vitale Aug 5 '16 at 10:08
  • I am stuck with the pset7 due to email sending problems, so I need to test everything on my local machine. To do so I have to learn how to use pset7 files on my machine. I have written all files 3 days ago (tested all in the IDE, all work except for my email_link.php), and since then struggling with technical issues. I am very thankful to @ChrisG for great help on learning how to use phpmailer code to send emails. Now I hope to get help on running pset7 locally. Thank you very much! – Vitale Aug 5 '16 at 10:20
  • Did you try to run the code I posted to your previous question, in the cs50.io? – ChrisG Aug 5 '16 at 10:36
  • @ChrisG Sorry, not yet. I am struggling with phpmailer on my machine - trying to figure out how to use it; at least I have managed to download it from the github ) – Vitale Aug 5 '16 at 14:00

The error suggests that you need to do a:

chmod a+r .htaccess

within your "public" directory?

  • Thank you very much for your answer. While searching for the answer, I have played around with settings, and now seem to have run into other issues, this time caused by my actions. Hope to dig through all this ) – Vitale Sep 2 '16 at 8:05

Ohai @Vitale!

I don't know how I missed this one. Anyway, I've consolidated my advice from several sources into this definitive guide on the CS50 Reddit.

Please read the guide! I hope it helps you.

Also, the CS50 PHP library, as written, is not entirely portable. It uses JanRain's OpenID library to make sure that a user is logged in to Harvard or edX before allowing them to execute a CS50::query statement.

If you need to run the code outside of the CS50 IDE, Malan has licensed the code under a very permissive open source license which allows you to modify the code so that this authentication is no longer required, provided that you leave the licensing information intact and do not pretend that you wrote the code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .