Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Apache2 + php5 i biała strona.
Forum PHP.pl > Forum > Serwery WWW
BloodyWampire
Witam.
Mam problem ze stroną na moim serwerze.
System debian 8.
Wersja Apache: 2.4.10
Wersja PHP: 5.6.29-0+deb8u1
A więc chodzi o to że wgrałem gotowy cms ale zamiast strony głównej wyświetla mi się pusta strona.
Nie wiem o co chodzi. Próbowałem w php.ini włączyć wyświetlanie błędów na stronie ale nic to nie zmienia.
Link do strony: http://77.81.230.185
phpinfo: http://77.81.230.185/info.php
Plik index.php:

  1. <?php
  2. require_once("inc/init.php");
  3. // Load basic settings into variables so it wont be loading database queries more times then needed
  4. $websiteTitle = Core::getSiteTitle();
  5. // Load basic settings into variables so it wont be loading database queries more times then needed
  6. ?>
  7.  
  8. <!DOCTYPE html>
  9. <html>
  10.  
  11. <head>
  12. <base href="http://localhost/mt2grand-cms/"/>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  14. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  15. <title><?= $websiteTitle.Core::printTitle();?></title>
  16. <link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,200,200italic,300,300italic,400italic,600,600italic,700
  17. ,700italic,900&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css'>
  18. <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  19. <link href="assets/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  20. <link href="assets/css/animate.css" rel="stylesheet" type="text/css">
  21. <link href="assets/css/owl.carousel.css" rel="stylesheet" type="text/css">
  22. <link href="assets/css/owl.theme.css" rel="stylesheet" type="text/css">
  23. <link href="assets/css/owl.transitions.css" rel="stylesheet" type="text/css">
  24. <link href="assets/css/creative-brands.css" rel="stylesheet" type="text/css">
  25. <link href="assets/css/jquery.vegas.min.css" rel="stylesheet" type="text/css">
  26. <link href="assets/css/magnific-popup.css" rel="stylesheet" type="text/css">
  27. <link href="assets/css/custom.css" rel="stylesheet" type="text/css">
  28. <link rel="shortcut icon" href="assets/images/favicon/favicon.ico" type="image/x-icon">
  29. <link rel="icon" href="assets/images/favicon/favicon.ico" type="image/x-icon">
  30.  
  31. <!--[if lt IE 9]>
  32. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  33. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  34. <![endif]-->
  35.  
  36. </head>
  37. <body>
  38.  
  39. <?php
  40. if(!Core::maintenanceEnabled()) {
  41.  
  42. ?>
  43. <header class="navbar navbar-default navbar-fixed-top">
  44. <div class="container">
  45. <div class="navbar-header">
  46. <a href="<?= Links::getUrl("index"); ?>" class="navbar-brand visible-xs"><?= $websiteTitle; ?></a>
  47. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><i
  48. class="fa fa-bars"></i></button>
  49. </div>
  50. <div class="navbar-collapse collapse">
  51. <ul class="nav navbar-nav">
  52. <?php
  53. Links::makeMenu();
  54. ?>
  55. </ul>
  56. <div class="pull-right navbar-buttons hidden-xs">
  57. <?php
  58. if (User::isLogged()) {
  59. echo '<a href="' . Links::getUrl("account") . '" class="btn btn-primary">' . Language::getTranslation("accountButton") . '</a>';
  60. echo '<a href="' . Links::getUrl("logout") . '" class="btn btn-inverse">' . Language::getTranslation("logoutButton") . '</a>';
  61. } else {
  62. echo '<a href="' . Links::getUrl("register") . '" class="btn btn-primary">' . Language::getTranslation("register") . '</a>';
  63. echo '<a href="' . Links::getUrl("login") . '" class="btn btn-inverse">' . Language::getTranslation("login") . '</a>';
  64. }
  65. ?>
  66. <a class="navbar-icon show2" id="open-search"><i class="fa fa-search"></i></a>
  67. <a class="navbar-icon hidden" id="close-search"><i class="fa fa-times"></i></a>
  68.  
  69. <div class="hidden" id="navbar-search-form">
  70. <form method="POST" action="<?= Links::getUrl("search"); ?>" role="search">
  71. <div class="form-group">
  72. <div class="input-group">
  73. <input type="text" value="" name="phrase" id="navbar-search" class="form-control"
  74. placeholder="<?= Language::getTranslation("search"); ?>">
  75. <span class="input-group-btn"><button class="btn btn-primary" type="submit"
  76. name="search" id="navbar-search-submit"><i
  77. class="fa fa-search"></i></button></span>
  78. </div>
  79. </div>
  80. </form>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </header>
  86. <?php
  87. }
  88. ?>
  89.  
  90. <div class="container hidden-xs">
  91. <div class="header-title">
  92. <div class="pull-left">
  93. <h2><a href="<?= Links::getUrl("index");?>"><?= Core::getHeaderTitle(false);?></a></h2>
  94. <p><?= Core::getHeaderSlogan();?></p>
  95. </div>
  96. </div>
  97. </div>
  98.  
  99. <div class="container">
  100. <div class="jumbotron">
  101. <div class="jumbotron-panel">
  102. <div class="panel panel-primary collapse-horizontal">
  103. <a data-toggle="collapse" class="btn btn-primary collapsed" data-target="#toggle-collapse">
  104. <?= Language::getTranslation("serverStatus");?> <i class="fa fa-caret-down"></i>
  105. </a>
  106. <div class="jumbotron-brands">
  107. <ul class="brands brands-sm brands-inline brands-circle">
  108. <?= Core::getSocialLink("facebook");?>
  109. <?= Core::getSocialLink("twitter");?>
  110. <?= Core::getSocialLink("youtube");?>
  111. <?= Core::getSocialLink("twitch");?>
  112. </ul>
  113. </div>
  114. <div id="toggle-collapse" class="panel-collapse collapse">
  115. <div class="panel-body">
  116. <?= Panel::getServerStatusPanel();?>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121.  
  122. <?php
  123. if(!Core::maintenanceEnabled()) {
  124. $slider = new Slider();
  125. $slider->makeSlider();
  126. }
  127. ?>
  128. </div>
  129. </div>
  130. <?php
  131. $panels = new Panel();
  132. ?>
  133. <div class="container">
  134. <section class="content-wrapper">
  135.  
  136.  
  137. <?php
  138. if(Core::maintenanceEnabled())
  139. {
  140. echo '<div class="error">';
  141. echo '<h2>'.Language::getTranslation("maintenanceTitle").'</h2>';
  142. echo '<p>'.Core::getMaintenanceText().'</p>';
  143. echo '</div>';
  144. }
  145. elseif(isset($_GET["page"]) AND $_GET["page"] == "itemshop")
  146. {
  147. if(file_exists("pages/itemshop.php"))
  148. {
  149. require_once("pages/itemshop.php");
  150. }
  151. } else
  152. {
  153. ?>
  154. <div class="row">
  155. <div class="col-sm-4 hidden-xs">
  156. <?php
  157. $panels->printPanels();
  158. ?>
  159. </div>
  160.  
  161. <div class="col-sm-8">
  162.  
  163. <?php
  164. $partners = new Partners();
  165. $partners->makePanel();
  166. ?>
  167.  
  168. <?php
  169. $router = new Router();
  170. ?>
  171.  
  172. </div>
  173. </div>
  174. <?php
  175. }
  176. ?>
  177.  
  178. </section>
  179. </div>
  180.  
  181. <div class="container">
  182. <?php
  183. if(!Core::maintenanceEnabled()) {
  184. $panels->printFooterBox();
  185. }
  186. ?>
  187. <footer class="navbar navbar-default">
  188. <div class="row">
  189. <div class="col-md-6 hidden-xs hidden-sm">
  190. <p class="copyright2"><?= Core::getFooterText();?></p>
  191. </div>
  192. <div class="col-md-6">
  193. <p class="copyright">MT2Grand CMS by <a href="skype:lol-m4n?add">ondry</a></p>
  194. </div>
  195. </div>
  196. </footer>
  197. </div>
  198.  
  199. <!-- Scripts are in the end of the file - so page loads faster -->
  200. <script src="assets/js/jquery-latest.min.js"></script>
  201. <script src="assets/js/bootstrap.min.js"></script>
  202. <script src="assets/js/owl.carousel.js"></script>
  203. <script src="assets/js/jquery.magnific-popup.min.js"></script>
  204. <script src="assets/js/creative-brands.js"></script>
  205. <script src="assets/js/jquery.vegas.min.js"></script>
  206. <script src="assets/js/twitterFetcher_min.js"></script>
  207. <script src="assets/js/jquery.countdown.min.js"></script>
  208. <script src="assets/js/custom.js"></script>
  209. </body>
  210.  
  211. </html>


Liczę że ktoś pomoże mi się uporać z tym problemem smile.gif
nospor
Przejrzyj logi. Skoro strona z phpinfo dziala, znaczy ze skrypt ci sie wywala bo cos tam. To cos tam bedzie w logach
viking
display_errors jest na off. Zobacz logi serwera. Nie pusta strona tylko 500 - internal server error.
BloodyWampire
XXX

Ok. W logach znalazłem parę błędów..

Cytat(viking @ 9.01.2017, 17:50:45 ) *
display_errors jest na off. Zobacz logi serwera. Nie pusta strona tylko 500 - internal server error.


Nope. Ustawiłem na on.
viking
Cytat
Note:

Although display_errors may be set at runtime (with ini_set()), it won't have any effect if the script has fatal errors. This is because the desired runtime action does not get executed.


Przestaw w php.ini, error_reporting(-1); i zobacz jeszcze raz.
nospor
Cytat
Nope. Ustawiłem na on.

phpinfo wyraznie mowi ze masz Off.
A jesli to ustawiles w skrypcie index.php to na nic sie to zda gdy skrypt ma parse errrory.

PRzejrzyj logi. Jak nie wiesz gdzie to jest takie cos jak google
BloodyWampire
Cytat(nospor @ 9.01.2017, 17:55:47 ) *
phpinfo wyraznie mowi ze masz Off.
A jesli to ustawiles w skrypcie index.php to na nic sie to zda gdy skrypt ma parse errrory.

PRzejrzyj logi. Jak nie wiesz gdzie to jest takie cos jak google



Cytat(BloodyWampire @ 9.01.2017, 18:00:13 ) *
Tutaj dam to co jest w logach apacha:
https://justpaste.it/128zn

Zawartość pliku który sprawia problemy:

  1. <?php
  2.  
  3. class Database
  4. {
  5.  
  6. private static $connection;
  7.  
  8. private static $settings = array(
  9. PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
  10. PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
  11. PDO::ATTR_EMULATE_PREPARES => false,
  12. );
  13.  
  14. public static function connect($host, $username, $password, $dbname) {
  15. if (!isset(self::$connection)) {
  16. self::$connection = @new PDO(
  17. "mysql:host=$host;dbname=$dbname",
  18. $username,
  19. $password,
  20. self::$settings
  21. );
  22. }
  23. }
  24.  
  25. // Return the 1st row
  26. public static function queryAlone($query, $parameters = array()) {
  27. $result = self::$connection->prepare($query);
  28. $result->execute($parameters);
  29. return $result->fetch();
  30. }
  31.  
  32. // Return all rows
  33. public static function queryAll($query, $parameters = array()) {
  34. $result = self::$connection->prepare($query);
  35. $result->execute($parameters);
  36. return $result->fetchAll();
  37. }
  38.  
  39. // Return the number of affected rows
  40. public static function query($query, $parameters = array()) {
  41. $result = self::$connection->prepare($query);
  42. $result->execute($parameters);
  43. return $result->rowCount();
  44. }
  45.  
  46. }
nospor
Doinstaluj pdo_mysql
BloodyWampire
Cytat(nospor @ 9.01.2017, 18:29:37 ) *
Doinstaluj pdo_mysql


Właśnie to zrobiłem.
Jak możesz zauważyć strona ładuje się ale tak jakby nie wczytywała style.css
@Edit
Oki wszystko śmiga ładniutko smile.gif
Panu Puchatkowi bardzo dziękuję, i na przyszłość będę wiedział gdzie szukać pomocy Lkingsmiley.png
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.