Apache not loading php

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

So I've been reading posts about this same issue for some time now and came to no conclusion.

I developed a website on php 7 on windows , everything was working correctly on localhost with php built-in server so I assumed , great let's put it on the server only problem is that either


this line get's completely ignored on my index.php

Here's whats inside get_yards.php.


and if I ignore this 'middle-man' I get a

GET http://website/bicker.php 500 (Internal Server Error)

here's whats inside get_yards2.php

array( "Database"=>$dbName, "UID"=>$dbUser, "PWD"=>$dbPass);
$conn = sqlsrv_connect( $dbHost, $connectionInfo);
if( $conn === false ) {
     die( print_r( sqlsrv_errors(), true));
}

$query = "SELECT YardId,Yard FROM YWBYard"; 
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );

$result = sqlsrv_query($conn, $query);

if( $result === false){
    if( ($errors = sqlsrv_errors() ) != null) {
        foreach( $errors as $error ) {
            echo "SQLSTATE: ".$error[ 'SQLSTATE']."
"; echo "code: ".$error[ 'code']."
"; echo "message: ".$error[ 'message']."
"; } } } else { $numRows = sqlsrv_num_rows($result); while($row = sqlsrv_fetch_array($result)) { if($row['YardId']===1){ echo "
  • "."".$row['Yard'],"
  • "; } elseif($row['YardId']===2){ echo "
  • "."".$row['Yard'],"
  • "; } else{ echo "
  • "."".$row['Yard'],"
  • "; } } } sqlsrv_free_stmt($result); sqlsrv_close($conn); ?>

    I'm open to trying anything at this point.

    Here are the server error logs

    PHP Fatal error: require(): Failed opening required '/resources/library/get_yards.php' (include_path='.:/usr/share/php') in /var/www/get_yards.php on line 2

    so I tried using this instead

    
    

    the same server error (GET 500 (INTERNAL SERVER ERROR))

    No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.