Php 7.2.15 doesn't load correctly












0















I have been having problems with Apache2 loading php. First it printed raw code to the screen. Then I ran sudo apt-get install php libapache2-mod-php and sudo a2enmod mpm_prefork && sudo a2enmod php7.0. The 2nd command appeared to be unneeded but the 1st moved the issue forward slightly.



Running this test file in the browser (from /var/www/html):



// http://localhost/test.php
<?
phpinfo();


shows this:



1024) //{ // $bandwidth = round($bandwidth / 1024 , 2); 
// $bandwidth .= " MB"; //} //else //{ // $bandwidth .= " KB";
//} // //switch (@$_GET['download']) { //case 'resume_speed':
//case 'noresume_speed': //case 'resume': //case 'noresume':
// $object->set_byfile($FILENAME); // if ($_GET['download'] ==
'noresume' || $_GET['download'] == 'noresume_speed')
$object->use_resume = false; // if ($_GET['download'] ==
'resume_speed' || $_GET['download'] == 'noresume_speed' )
$object->speed = 100; // $object->download(); //break;
//case 'data': //case 'dataresume': // $data = implode('' ,
file($FILENAME)); // $object->set_bydata($data); // if
($_SERVER['download'] != 'dataresume') $object->use_resume =
false; // $object->filename = basename($FILENAME);
// $object->download(); //break; //case 'auth':
// $object->set_byfile($FILENAME); // $object->use_auth =
true; // $object->handler['auth'] = "test_auth"; // $object-
>download(); //break; //case 'url': // $object-
>set_byurl('http://www.php.net/get/php_manual_chm.zip/from/cr.
php.net/mirror'); // $object->download(); //break; //} // //if
($object->bandwidth > 0) //{ // error_reporting(E_NONE); // $b
= intval(implode('',file('bandwidth.txt'))) + $object-
>bandwidth; // $f = fopen('bandwidth.txt','wb'); //
fwrite($f,$b); // fclose($f); // exit; //} // //function
test_auth($user,$pass) { //test authentication function // if
($user == 'user' && $pass == 'pass') return true; // return
false; //} // //?> -->


Black text on white background. No formating.



Going to the root of a wordpress directory (with an index.php file) shows this (black text white background):



<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );


I've tried to remove/purse and install both apache2 and php several times. I also tried stopping and restarting the apache2 service.



Does anyone know what the issue could be?



Here are my versions:



owner@G700:/var/www/wptest1$ apache2 -v
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2018-10-10T18:59:25

owner@G700:/var/www/wptest1$ php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


I'm on Lubuntu 18.04










share|improve this question





























    0















    I have been having problems with Apache2 loading php. First it printed raw code to the screen. Then I ran sudo apt-get install php libapache2-mod-php and sudo a2enmod mpm_prefork && sudo a2enmod php7.0. The 2nd command appeared to be unneeded but the 1st moved the issue forward slightly.



    Running this test file in the browser (from /var/www/html):



    // http://localhost/test.php
    <?
    phpinfo();


    shows this:



    1024) //{ // $bandwidth = round($bandwidth / 1024 , 2); 
    // $bandwidth .= " MB"; //} //else //{ // $bandwidth .= " KB";
    //} // //switch (@$_GET['download']) { //case 'resume_speed':
    //case 'noresume_speed': //case 'resume': //case 'noresume':
    // $object->set_byfile($FILENAME); // if ($_GET['download'] ==
    'noresume' || $_GET['download'] == 'noresume_speed')
    $object->use_resume = false; // if ($_GET['download'] ==
    'resume_speed' || $_GET['download'] == 'noresume_speed' )
    $object->speed = 100; // $object->download(); //break;
    //case 'data': //case 'dataresume': // $data = implode('' ,
    file($FILENAME)); // $object->set_bydata($data); // if
    ($_SERVER['download'] != 'dataresume') $object->use_resume =
    false; // $object->filename = basename($FILENAME);
    // $object->download(); //break; //case 'auth':
    // $object->set_byfile($FILENAME); // $object->use_auth =
    true; // $object->handler['auth'] = "test_auth"; // $object-
    >download(); //break; //case 'url': // $object-
    >set_byurl('http://www.php.net/get/php_manual_chm.zip/from/cr.
    php.net/mirror'); // $object->download(); //break; //} // //if
    ($object->bandwidth > 0) //{ // error_reporting(E_NONE); // $b
    = intval(implode('',file('bandwidth.txt'))) + $object-
    >bandwidth; // $f = fopen('bandwidth.txt','wb'); //
    fwrite($f,$b); // fclose($f); // exit; //} // //function
    test_auth($user,$pass) { //test authentication function // if
    ($user == 'user' && $pass == 'pass') return true; // return
    false; //} // //?> -->


    Black text on white background. No formating.



    Going to the root of a wordpress directory (with an index.php file) shows this (black text white background):



    <?php
    /**
    * Front to the WordPress application. This file doesn't do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define( 'WP_USE_THEMES', true );

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . '/wp-blog-header.php' );


    I've tried to remove/purse and install both apache2 and php several times. I also tried stopping and restarting the apache2 service.



    Does anyone know what the issue could be?



    Here are my versions:



    owner@G700:/var/www/wptest1$ apache2 -v
    Server version: Apache/2.4.29 (Ubuntu)
    Server built: 2018-10-10T18:59:25

    owner@G700:/var/www/wptest1$ php -v
    PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


    I'm on Lubuntu 18.04










    share|improve this question



























      0












      0








      0








      I have been having problems with Apache2 loading php. First it printed raw code to the screen. Then I ran sudo apt-get install php libapache2-mod-php and sudo a2enmod mpm_prefork && sudo a2enmod php7.0. The 2nd command appeared to be unneeded but the 1st moved the issue forward slightly.



      Running this test file in the browser (from /var/www/html):



      // http://localhost/test.php
      <?
      phpinfo();


      shows this:



      1024) //{ // $bandwidth = round($bandwidth / 1024 , 2); 
      // $bandwidth .= " MB"; //} //else //{ // $bandwidth .= " KB";
      //} // //switch (@$_GET['download']) { //case 'resume_speed':
      //case 'noresume_speed': //case 'resume': //case 'noresume':
      // $object->set_byfile($FILENAME); // if ($_GET['download'] ==
      'noresume' || $_GET['download'] == 'noresume_speed')
      $object->use_resume = false; // if ($_GET['download'] ==
      'resume_speed' || $_GET['download'] == 'noresume_speed' )
      $object->speed = 100; // $object->download(); //break;
      //case 'data': //case 'dataresume': // $data = implode('' ,
      file($FILENAME)); // $object->set_bydata($data); // if
      ($_SERVER['download'] != 'dataresume') $object->use_resume =
      false; // $object->filename = basename($FILENAME);
      // $object->download(); //break; //case 'auth':
      // $object->set_byfile($FILENAME); // $object->use_auth =
      true; // $object->handler['auth'] = "test_auth"; // $object-
      >download(); //break; //case 'url': // $object-
      >set_byurl('http://www.php.net/get/php_manual_chm.zip/from/cr.
      php.net/mirror'); // $object->download(); //break; //} // //if
      ($object->bandwidth > 0) //{ // error_reporting(E_NONE); // $b
      = intval(implode('',file('bandwidth.txt'))) + $object-
      >bandwidth; // $f = fopen('bandwidth.txt','wb'); //
      fwrite($f,$b); // fclose($f); // exit; //} // //function
      test_auth($user,$pass) { //test authentication function // if
      ($user == 'user' && $pass == 'pass') return true; // return
      false; //} // //?> -->


      Black text on white background. No formating.



      Going to the root of a wordpress directory (with an index.php file) shows this (black text white background):



      <?php
      /**
      * Front to the WordPress application. This file doesn't do anything, but loads
      * wp-blog-header.php which does and tells WordPress to load the theme.
      *
      * @package WordPress
      */

      /**
      * Tells WordPress to load the WordPress theme and output it.
      *
      * @var bool
      */
      define( 'WP_USE_THEMES', true );

      /** Loads the WordPress Environment and Template */
      require( dirname( __FILE__ ) . '/wp-blog-header.php' );


      I've tried to remove/purse and install both apache2 and php several times. I also tried stopping and restarting the apache2 service.



      Does anyone know what the issue could be?



      Here are my versions:



      owner@G700:/var/www/wptest1$ apache2 -v
      Server version: Apache/2.4.29 (Ubuntu)
      Server built: 2018-10-10T18:59:25

      owner@G700:/var/www/wptest1$ php -v
      PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


      I'm on Lubuntu 18.04










      share|improve this question
















      I have been having problems with Apache2 loading php. First it printed raw code to the screen. Then I ran sudo apt-get install php libapache2-mod-php and sudo a2enmod mpm_prefork && sudo a2enmod php7.0. The 2nd command appeared to be unneeded but the 1st moved the issue forward slightly.



      Running this test file in the browser (from /var/www/html):



      // http://localhost/test.php
      <?
      phpinfo();


      shows this:



      1024) //{ // $bandwidth = round($bandwidth / 1024 , 2); 
      // $bandwidth .= " MB"; //} //else //{ // $bandwidth .= " KB";
      //} // //switch (@$_GET['download']) { //case 'resume_speed':
      //case 'noresume_speed': //case 'resume': //case 'noresume':
      // $object->set_byfile($FILENAME); // if ($_GET['download'] ==
      'noresume' || $_GET['download'] == 'noresume_speed')
      $object->use_resume = false; // if ($_GET['download'] ==
      'resume_speed' || $_GET['download'] == 'noresume_speed' )
      $object->speed = 100; // $object->download(); //break;
      //case 'data': //case 'dataresume': // $data = implode('' ,
      file($FILENAME)); // $object->set_bydata($data); // if
      ($_SERVER['download'] != 'dataresume') $object->use_resume =
      false; // $object->filename = basename($FILENAME);
      // $object->download(); //break; //case 'auth':
      // $object->set_byfile($FILENAME); // $object->use_auth =
      true; // $object->handler['auth'] = "test_auth"; // $object-
      >download(); //break; //case 'url': // $object-
      >set_byurl('http://www.php.net/get/php_manual_chm.zip/from/cr.
      php.net/mirror'); // $object->download(); //break; //} // //if
      ($object->bandwidth > 0) //{ // error_reporting(E_NONE); // $b
      = intval(implode('',file('bandwidth.txt'))) + $object-
      >bandwidth; // $f = fopen('bandwidth.txt','wb'); //
      fwrite($f,$b); // fclose($f); // exit; //} // //function
      test_auth($user,$pass) { //test authentication function // if
      ($user == 'user' && $pass == 'pass') return true; // return
      false; //} // //?> -->


      Black text on white background. No formating.



      Going to the root of a wordpress directory (with an index.php file) shows this (black text white background):



      <?php
      /**
      * Front to the WordPress application. This file doesn't do anything, but loads
      * wp-blog-header.php which does and tells WordPress to load the theme.
      *
      * @package WordPress
      */

      /**
      * Tells WordPress to load the WordPress theme and output it.
      *
      * @var bool
      */
      define( 'WP_USE_THEMES', true );

      /** Loads the WordPress Environment and Template */
      require( dirname( __FILE__ ) . '/wp-blog-header.php' );


      I've tried to remove/purse and install both apache2 and php several times. I also tried stopping and restarting the apache2 service.



      Does anyone know what the issue could be?



      Here are my versions:



      owner@G700:/var/www/wptest1$ apache2 -v
      Server version: Apache/2.4.29 (Ubuntu)
      Server built: 2018-10-10T18:59:25

      owner@G700:/var/www/wptest1$ php -v
      PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


      I'm on Lubuntu 18.04







      server 18.04 lubuntu apache2 php






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago







      Sean Dezoysa

















      asked 5 hours ago









      Sean DezoysaSean Dezoysa

      1205




      1205






















          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%2f1125734%2fphp-7-2-15-doesnt-load-correctly%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%2f1125734%2fphp-7-2-15-doesnt-load-correctly%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

          GameSpot

          connect to host localhost port 22: Connection refused

          Getting a Wifi WPA2 wifi connection