How to configure apache webserver to run php? Announcing the arrival of Valued Associate #679:...

51k Euros annually for a family of 4 in Berlin: Is it enough?

What causes the vertical darker bands in my photo?

How to react to hostile behavior from a senior developer?

Do I really need recursive chmod to restrict access to a folder?

Should I discuss the type of campaign with my players?

How do I stop a creek from eroding my steep embankment?

Output the ŋarâþ crîþ alphabet song without using (m)any letters

Should I use a zero-interest credit card for a large one-time purchase?

Can a USB port passively 'listen only'?

What does the "x" in "x86" represent?

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

What is the role of the transistor and diode in a soft start circuit?

Can I cast Passwall to drop an enemy into a 20-foot pit?

3 doors, three guards, one stone

Can a non-EU citizen traveling with me come with me through the EU passport line?

Generate an RGB colour grid

Is it true that "carbohydrates are of no use for the basal metabolic need"?

Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?

What does an IRS interview request entail when called in to verify expenses for a sole proprietor small business?

How does debian/ubuntu knows a package has a updated version

String `!23` is replaced with `docker` in command line

How can I make names more distinctive without making them longer?

Using audio cues to encourage good posture

What's the meaning of 間時肆拾貳 at a car parking sign



How to configure apache webserver to run php?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionInstall apache,php and mysql on CentOS VPSdifference between Apache installationsDebian, Apache, mod_userdir, suexec, php-cgihow can I configure Apache so that PHP scripts are run with permissions of the owner of the script?httpd (apache2) server doesn't parse *.php files but displays them as text with installed php-moduleApache Server setup issueCan't get php 7.1 to work on apache 2.4 (FAMP)PHP in a embedded apache web server built with buildrootRunning Bash Script in a Browser Even with Apache Permissions SetHow can I reinstall php and apache on mac? I deleted some important php folders





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







-1















I am administering an apache webserver: Apache/2.2.22 (Debian)



It's essentially acting as a monitor program for some industrial processes that might get 4 or 5 views a day. It has an httpd root directory of /var/www so things put in this read-only directory tree get served up as https://ourdomain.com/things.html. There's some javascript and css stuff in (surprise!) /var/www/js and /var/www/css which are referred to in the html as "/css/something.css" and "/js/something.js". There's also a lot of perl scripts interfacing with a backend postgresql database on this box. They live in the cgi-bin directory tree of /usr/lib/cgi-bin which has read and execute access. All is happy - all three things work together just fine.



Now we want to add some menus to run non-periodic tasks back in the database. The first step is to have a sign-on screen and all of the contractors we contacted to do this wanted to use PHP. So we added PHP 7.0.27-0+deb9u1 and the PHP cgi-bin module and the contractor we chose gave us a pile of PHP code to install on the server which we did in /usr/lib/cgi-bin/php-cgi. While a basic "Hello, world" program works fine anything that references css or js elements falls over with a "server misconfiguration" type error.



This seems to be because all this PHP code refers to this stuff through relative and not absolute paths. So where it includes some header css it refers to it as "css/headers". This blows up because there is no /usr/lib/cgi-bin/php-cgi/css directory. If we make one it still blows up because now this javascript and css code is in the cgi-bin directory tree which has execute access (at least in the upper levels) and apache seems to think that css files with any execute access around are security heresy. If I alias css somehow to the httpd root directory then what happens to my existing /css code? We tried adding a leading slash to the PHP includes but that was a deadend as there's too many levels of PHP libraries that cross-reference all this css and javascript stuff and would be a maintenance nightmare if, as advertised, most of this stuff is all the standard boilerplate PHP.



We've got to be missing some superliminal tweak that everyone takes for granted (nothing about any of this in the docs for apache2 or any of the PHP code or mods). Please send me some magic bullet: a soft link I need to put in somewhere, an Apache configuration line, another mod to install...










share|improve this question































    -1















    I am administering an apache webserver: Apache/2.2.22 (Debian)



    It's essentially acting as a monitor program for some industrial processes that might get 4 or 5 views a day. It has an httpd root directory of /var/www so things put in this read-only directory tree get served up as https://ourdomain.com/things.html. There's some javascript and css stuff in (surprise!) /var/www/js and /var/www/css which are referred to in the html as "/css/something.css" and "/js/something.js". There's also a lot of perl scripts interfacing with a backend postgresql database on this box. They live in the cgi-bin directory tree of /usr/lib/cgi-bin which has read and execute access. All is happy - all three things work together just fine.



    Now we want to add some menus to run non-periodic tasks back in the database. The first step is to have a sign-on screen and all of the contractors we contacted to do this wanted to use PHP. So we added PHP 7.0.27-0+deb9u1 and the PHP cgi-bin module and the contractor we chose gave us a pile of PHP code to install on the server which we did in /usr/lib/cgi-bin/php-cgi. While a basic "Hello, world" program works fine anything that references css or js elements falls over with a "server misconfiguration" type error.



    This seems to be because all this PHP code refers to this stuff through relative and not absolute paths. So where it includes some header css it refers to it as "css/headers". This blows up because there is no /usr/lib/cgi-bin/php-cgi/css directory. If we make one it still blows up because now this javascript and css code is in the cgi-bin directory tree which has execute access (at least in the upper levels) and apache seems to think that css files with any execute access around are security heresy. If I alias css somehow to the httpd root directory then what happens to my existing /css code? We tried adding a leading slash to the PHP includes but that was a deadend as there's too many levels of PHP libraries that cross-reference all this css and javascript stuff and would be a maintenance nightmare if, as advertised, most of this stuff is all the standard boilerplate PHP.



    We've got to be missing some superliminal tweak that everyone takes for granted (nothing about any of this in the docs for apache2 or any of the PHP code or mods). Please send me some magic bullet: a soft link I need to put in somewhere, an Apache configuration line, another mod to install...










    share|improve this question



























      -1












      -1








      -1








      I am administering an apache webserver: Apache/2.2.22 (Debian)



      It's essentially acting as a monitor program for some industrial processes that might get 4 or 5 views a day. It has an httpd root directory of /var/www so things put in this read-only directory tree get served up as https://ourdomain.com/things.html. There's some javascript and css stuff in (surprise!) /var/www/js and /var/www/css which are referred to in the html as "/css/something.css" and "/js/something.js". There's also a lot of perl scripts interfacing with a backend postgresql database on this box. They live in the cgi-bin directory tree of /usr/lib/cgi-bin which has read and execute access. All is happy - all three things work together just fine.



      Now we want to add some menus to run non-periodic tasks back in the database. The first step is to have a sign-on screen and all of the contractors we contacted to do this wanted to use PHP. So we added PHP 7.0.27-0+deb9u1 and the PHP cgi-bin module and the contractor we chose gave us a pile of PHP code to install on the server which we did in /usr/lib/cgi-bin/php-cgi. While a basic "Hello, world" program works fine anything that references css or js elements falls over with a "server misconfiguration" type error.



      This seems to be because all this PHP code refers to this stuff through relative and not absolute paths. So where it includes some header css it refers to it as "css/headers". This blows up because there is no /usr/lib/cgi-bin/php-cgi/css directory. If we make one it still blows up because now this javascript and css code is in the cgi-bin directory tree which has execute access (at least in the upper levels) and apache seems to think that css files with any execute access around are security heresy. If I alias css somehow to the httpd root directory then what happens to my existing /css code? We tried adding a leading slash to the PHP includes but that was a deadend as there's too many levels of PHP libraries that cross-reference all this css and javascript stuff and would be a maintenance nightmare if, as advertised, most of this stuff is all the standard boilerplate PHP.



      We've got to be missing some superliminal tweak that everyone takes for granted (nothing about any of this in the docs for apache2 or any of the PHP code or mods). Please send me some magic bullet: a soft link I need to put in somewhere, an Apache configuration line, another mod to install...










      share|improve this question
















      I am administering an apache webserver: Apache/2.2.22 (Debian)



      It's essentially acting as a monitor program for some industrial processes that might get 4 or 5 views a day. It has an httpd root directory of /var/www so things put in this read-only directory tree get served up as https://ourdomain.com/things.html. There's some javascript and css stuff in (surprise!) /var/www/js and /var/www/css which are referred to in the html as "/css/something.css" and "/js/something.js". There's also a lot of perl scripts interfacing with a backend postgresql database on this box. They live in the cgi-bin directory tree of /usr/lib/cgi-bin which has read and execute access. All is happy - all three things work together just fine.



      Now we want to add some menus to run non-periodic tasks back in the database. The first step is to have a sign-on screen and all of the contractors we contacted to do this wanted to use PHP. So we added PHP 7.0.27-0+deb9u1 and the PHP cgi-bin module and the contractor we chose gave us a pile of PHP code to install on the server which we did in /usr/lib/cgi-bin/php-cgi. While a basic "Hello, world" program works fine anything that references css or js elements falls over with a "server misconfiguration" type error.



      This seems to be because all this PHP code refers to this stuff through relative and not absolute paths. So where it includes some header css it refers to it as "css/headers". This blows up because there is no /usr/lib/cgi-bin/php-cgi/css directory. If we make one it still blows up because now this javascript and css code is in the cgi-bin directory tree which has execute access (at least in the upper levels) and apache seems to think that css files with any execute access around are security heresy. If I alias css somehow to the httpd root directory then what happens to my existing /css code? We tried adding a leading slash to the PHP includes but that was a deadend as there's too many levels of PHP libraries that cross-reference all this css and javascript stuff and would be a maintenance nightmare if, as advertised, most of this stuff is all the standard boilerplate PHP.



      We've got to be missing some superliminal tweak that everyone takes for granted (nothing about any of this in the docs for apache2 or any of the PHP code or mods). Please send me some magic bullet: a soft link I need to put in somewhere, an Apache configuration line, another mod to install...







      apache-httpd php php7






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago









      Rui F Ribeiro

      42.1k1484142




      42.1k1484142










      asked 5 hours ago









      NadreckNadreck

      1759




      1759






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f512860%2fhow-to-configure-apache-webserver-to-run-php%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 Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f512860%2fhow-to-configure-apache-webserver-to-run-php%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

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...