Why can't Apache2 look outside /var/www/html/ for a PHP file? The Next CEO of Stack...

Can you be charged for obstruction for refusing to answer questions?

What was the first Unix version to run on a microcomputer?

Method for adding error messages to a dictionary given a key

How do I align (1) and (2)?

Won the lottery - how do I keep the money?

Newlines in BSD sed vs gsed

How to check if all elements of 1 list are in the *same quantity* and in any order, in the list2?

TikZ: How to reverse arrow direction without switching start/end point?

How to edit “Name” property in GCI output?

Is it professional to write unrelated content in an almost-empty email?

How to get from Geneva Airport to Metabief, Doubs, France by public transport?

Should I tutor a student who I know has cheated on their homework?

How to avoid supervisors with prejudiced views?

Is there always a complete, orthogonal set of unitary matrices?

How did people program for Consoles with multiple CPUs?

Are police here, aren't itthey?

Proper way to express "He disappeared them"

Flying from Cape Town to England and return to another province

Is it okay to majorly distort historical facts while writing a fiction story?

Is French Guiana a (hard) EU border?

Bartok - Syncopation (1): Meaning of notes in between Grand Staff

How is this set of matrices closed under multiplication?

The exact meaning of 'Mom made me a sandwich'

Easy to read palindrome checker



Why can't Apache2 look outside /var/www/html/ for a PHP file?



The Next CEO of Stack Overflowphp change uploaded file ownerUbuntu - Is it normal that my apache webroot is in html directoryCannot create file in /var/www/htmlHow can I give SublimeText write permission for /var/www?I'm getting this “You should replace this file (located at /var/www/html/index.html)” after update to v14.4 ubuntuphpmyadmin installed but the page not rendered correctly by phpHow do I properly make a symlink for /var/www/html while keeping both security and function in mindIs it safe to have permission to create files in var/www/html?Can't access web folder after typing a chmod command (error 403)Can hackers inject anything to the server outside /var/www/html












0















I have just started to learn about the whole deal of PHP, MySql, and it's connections to front-end development. While doing this I found that I cannot execute a PHP file unless and until it is inside the /var/www/html directory. I have found out about this solution from multiple sources including askubuntu, but I could never find the reason as to why this is so. So does this mean that a PHP file always has to be inside this specific directory? Can I do anything to make a PHP file inside say, my Documents folder to run successfully instead of being "Save"-ad by Mozilla?
Please help.









share



























    0















    I have just started to learn about the whole deal of PHP, MySql, and it's connections to front-end development. While doing this I found that I cannot execute a PHP file unless and until it is inside the /var/www/html directory. I have found out about this solution from multiple sources including askubuntu, but I could never find the reason as to why this is so. So does this mean that a PHP file always has to be inside this specific directory? Can I do anything to make a PHP file inside say, my Documents folder to run successfully instead of being "Save"-ad by Mozilla?
    Please help.









    share

























      0












      0








      0








      I have just started to learn about the whole deal of PHP, MySql, and it's connections to front-end development. While doing this I found that I cannot execute a PHP file unless and until it is inside the /var/www/html directory. I have found out about this solution from multiple sources including askubuntu, but I could never find the reason as to why this is so. So does this mean that a PHP file always has to be inside this specific directory? Can I do anything to make a PHP file inside say, my Documents folder to run successfully instead of being "Save"-ad by Mozilla?
      Please help.









      share














      I have just started to learn about the whole deal of PHP, MySql, and it's connections to front-end development. While doing this I found that I cannot execute a PHP file unless and until it is inside the /var/www/html directory. I have found out about this solution from multiple sources including askubuntu, but I could never find the reason as to why this is so. So does this mean that a PHP file always has to be inside this specific directory? Can I do anything to make a PHP file inside say, my Documents folder to run successfully instead of being "Save"-ad by Mozilla?
      Please help.







      16.04 permissions apache2 php





      share












      share










      share



      share










      asked 4 mins ago









      The ViperThe Viper

      12




      12






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130051%2fwhy-cant-apache2-look-outside-var-www-html-for-a-php-file%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130051%2fwhy-cant-apache2-look-outside-var-www-html-for-a-php-file%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

          Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

          Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...