/    Sign up×
Community /Pin to ProfileBookmark

php seems to be not terminating

I had to set up a new dev machine and installed a LAMP stack with apache2.04, mysql8, and php7.4. My index.php used to work but on the new machine the php isn’t terminating. Here’s the code:

“`
`<?php

$php_scripts = ‘../php/’;
require $php_scripts . ‘PDO_Connection_Select.php’;
require $php_scripts . ‘GetUserIpAddr.php’;

{
$ip = GetUserIpAddr();
if (!$pdo = PDOConnect(“foxclone_data”)) {
exit;
}
{
$stmt = $pdo->prepare(“INSERT INTO download (address) values (?)”);
$stmt->execute([$ip]) ;
}
}

?>

<!DOCTYPE html> <!– showing brown like php code in editor –>
<html lang=”en”>
<head>
etc,etc….`
“`

This causes the following problem:

“`
`test is currently unable to handle this request.

HTTP ERROR 500`
“`

Does anyone have any ideas why this is happening? The code worked on the old machine.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 23.2020 — Might want to see if there's anything in the Apache logs? Maybe a file permission issue?
Copy linkTweet thisAlerts:
@act78723authorJul 23.2020 — Got it fixed by checking error log. When I recreated the database, it failed to set where the autoincrement should start at on the id field in a table. It's giving me a duplicate key error.
×

Success!

Help @act78723 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...