Jump to content

Recommended Posts

See below my website is showing like this

image.thumb.png.8dc1f42ed056cbaede0023225eab3300.png

I think debian upgraded from php 7.3 or 4 to 8.0

I am wondering if I am missing some php packages if run php -v at terminal I get

php -v
PHP 8.0.7 (cli) (built: Jun  4 2021 23:17:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies

and if I run php -m at terminal i get

php -m
[PHP Modules]
calendar
Core
ctype
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

 

 

 

This is the code of my indexx file

I don't think it's a problem with my code though as even my previous backups of my website aren't working.

And I also tried creating a phpinfo file with only phpinfo(); inside it and that isn't showing the php info screen

So I think it's more a problem with my PHP install on debian and maybe I'm missing some php modules on debian for php 8.0 or something

<?php 
include('classHeader.php');
include 'dbconnect.php'; 

session_start();
//Outputs header located in classHeader.php
$HeaderFromClass = new HeaderClass(); 
echo $HeaderFromClass->get_Header(); 
//Second part changes depending on whether a user is logged in 
echo $HeaderFromClass->get_Header2ndPart(); 
    ?>
      

<body> 
<div class ='grid-container'>
<?php


//Get the Threads and output them onto the screen in a grid container
$query = mysqli_query($conn, "select Threads.id as ThreadId, Title, Users, filename,url, LEFT(ThreadBody, 8000) as body, date_format(Thread_date, '%D %b %Y %l:%i %p') as ftime     , count(Posts.IdOfThread) as num_posts from Threads Left join Posts on Threads.id = Posts.IdOfThread group by Threads.id order by Thread_date desc;")
   or die (mysqli_error($conn));

while ($row = mysqli_fetch_array($query)) {

$videoURL = 'upload/' . rawurlencode($row["filename"]);
$imageURL = 'upload/Thumbnails/'.rawurlencode($row["filename"]);
$PostBody = nl2br($row['body']);

  echo 
   "  <div class ='grid-item'>	
	<div class='ThreadComment'> <a href='viewthread.php?id={$row['ThreadId']}'>  Comments:{$row['num_posts']} </a><br>  </div> 
	<div class='ThreadNumber'> <a href='viewthread.php?id={$row['ThreadId']}'>  Post {$row['ThreadId']}</a><br> </div> 
	<div class='indexpageUser'><a href='profile.php?id={$row['Users']}'> {$row['Users']} </a></div> 
      	<h2><a href='viewthread.php?id={$row['ThreadId']}'>  {$row['Title']} </a></h2> 
      	<a href='{$row['url']}'> {$row['url']}</a> 
      	
      <div class='mainpageUpvoteCount'> {$row['upvotes']} </div>" ;  
     //If user is logged in display upvote arrows. 
 		if(isset($_SESSION['username'])){
	echo 
    	" <div class='mainpageupvote' id='upvote'><form action='upvotes.php' method='post' enctype='multipart/form-data' ><button  name='ThreadID' value={$row['ThreadId']}> ⬆ </button></form></div> 
		<div class='mainpagedownvote'><button onclick='downvote()' value={$row['ThreadId']} > ⬇</button></div> 
  		    ";
    }
      
      echo "<div class ='img-block'>" ;  
				//If file is a PDF display standard PDF icon else select the filename from the uploads folder 
		  		if(strpos($imageURL, "pdf") !== false){
		 			echo "<a href='viewthread.php?id={$row['ThreadId']}'><img src='Icons/PDF.jpg' alt='' /> </a> " ;
		 			}
		 		if(strpos($videoURL, "mp4") !== false){
		  	$videocode = "<embed src=$videoURL autostart='false' height='200' width='200'/></embed>"	;
 		  	echo $videocode	; 	  	
		  	} 	
		  	if(strpos($videoURL, "webm") !== false){
		  	$videocode = "<embed src=$videoURL autostart='false' height='200' width='200'/></embed>"	;
 		  	echo $videocode	; 	  	
		  	} 					
		 		else { 
		 			echo "<a href='viewthread.php?id={$row['ThreadId']}'><img src={$row['$imageURL']}$imageURL alt='' /> </a>"; 
		 			}
		echo "
		</div> 
		
       <p>$PostBody </p>
      </div> 

    \n";
    
}

/*  "  <div class ='grid-item'>
   
	<div class='ThreadComment'> <a href='viewthread.php?id={$row['ThreadId']}'>  Comments:{$row['num_posts']} </a><br>  </div> 
	<div class='ThreadNumber'> <a href='viewthread.php?id={$row['ThreadId']}'>  Post {$row['ThreadId']}</a><br> </div> 
	<div class='indexpageUser'>{$row['Users']}  </div> 
      	<h2><a href='viewthread.php?id={$row['ThreadId']}'>  {$row['Title']} </a></h2> 
      <div class='mainpageUpvoteCount'> {$row['upvotes']} </div> 
      	 <div class='mainpageupvote' id='upvote'><button onclick='upvote()' class='upvotes' value={$row['ThreadId']}> ⬆ </button></div> 
		<div class='mainpagedownvote'><button onclick='downvote()' class='upvotes' value={$row['ThreadId']} > ⬇</button></div> 
		<div class ='img-block'>" ;  
		//If file is a PDF display standard PDF icon else select the filename from the uploads folder 
		  if(strpos($imageURL, "pdf") !== false){
		 echo "<a href='viewthread.php?id={$row['ThreadId']}'><img src='Icons/PDF.jpg' alt='' /> </a> " ;
		 }		
		 else { 
		 echo "<a href='viewthread.php?id={$row['ThreadId']}'><img src={$row['$imageURL']}$imageURL alt='' /> </a>"; 
		 }
		echo "
		</div> 
		
       <p>$PostBody </p>
      </div> 

    \n";
    */
?>

</body> 
</html> 



<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script> 
$('#grid-container').click(function(){
    $('#grid-item').animate({height:'600px'}, 500);
        $('#grid-item').animate({width:'600px'}, 500);
});


function upvote(){
      $.ajax({
        type: "POST",
        url: "upvotes.php",
		data: {$row['ThreadId']},
        success:function( msg ) {
         alert( "Data Saved: " + msg );
        }
       });
  }
</script> 

<script> 
function downvote(){
      $.ajax({
        type: "POST",
        url: "upvotes.php",
        data: name: $("select[name='players']").val()},
        success:function( msg ) {
         alert( "Data Saved: " + msg );
        }
       });
  }
</script> 

 

Your missing the configuration that integrates PHP with your web server.  This may be provided by a different package that you need to install or you might have to update the configuration by hand.  Search how to install php on whatever webserver you're using on debian and you can probably find instructions.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.