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

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Why does standard notation not preserve intervals (visually)

Can we say or write : "No, it'sn't"?

When you upcast Blindness/Deafness, do all targets suffer the same effect?

Won the lottery - how do I keep the money?

Grabbing quick drinks

Solving system of ODEs with extra parameter

How to edit “Name” property in GCI output?

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

Why, when going from special to general relativity, do we just replace partial derivatives with covariant derivatives?

WOW air has ceased operation, can I get my tickets refunded?

What flight has the highest ratio of timezone difference to flight time?

Why didn't Khan get resurrected in the Genesis Explosion?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

What connection does MS Office have to Netscape Navigator?

Why did CATV standarize in 75 ohms and everyone else in 50?

How to count occurrences of text in a file?

Can MTA send mail via a relay without being told so?

Does Germany produce more waste than the US?

Writing differences on a blackboard

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Make solar eclipses exceedingly rare, but still have new moons

Easy to read palindrome checker

How many extra stops do monopods offer for tele photographs?



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 1 min 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

          Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

          Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

          Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org