0

I'm a Linux newby and a PHP real newby trying to learn PHP. That probably means I need a little more step-by-step help. I've installed PHP 7.0 and Apache2 on Raspberry Pi Raspbian (Debian) Jessie. PHP Info displays when I ask it to from the browser, so I'm pretty sure I have a good install.

What I want to do is create and edit PHP scripts to learn PHP. The materials I'm working with say to drop the PHP files into htdocs or public_HTML. Those folders don't exist. What does exist is /var/www/html/ as the document root, and as the Pi user, I don't have access to document root folder. I presume that I must put new files into the document root in order to run them from a browser. Do I have this right, or do I need to create additional folders? What is best practices? I'm looking for minimum changes.

Presumably I need to change permissions for the Pi user to create, edit and move files in and out of where they run. If this is correct, what is it that I need to do?

Thank you in advance for the help.

VicinSF
  • 1
  • 2
  • Are you SSH into it or you using a GUI? Either way, add the pi user to www-data group. Or change ownership of the directory to the pi user `sudo chown -R "$USER":www-data /var/www`, the later will cause issues on editing files generated by apache until you re-run `sudo chown -R "$USER":www-data /var/www -R` – Lawrence Cherone Sep 26 '17 at 03:14
  • Have a read of https://askubuntu.com/questions/46331/how-to-avoid-using-sudo-when-working-in-var-www – Lawrence Cherone Sep 26 '17 at 03:17
  • Lawrence - Thank you. Solutions look good. Vic – VicinSF Sep 26 '17 at 14:52

0 Answers0