DWQA QuestionsCategory: ServerUbuntu 16.04 parses the PHP file as an empty page. How to solve this problem?
Tide Walker asked 4 weeks ago

After the lamp is installed and configured, phpinfo.php can be displayed normally
Ubuntu 16.04 parses the PHP file as an empty page. How to solve this problem?
However, the file msql_tets.php cannot be displayed. The code is as follows:

<?php
$link = mysql_connect("localhost", "root","hufan.88");
if(!$link)die('Could not connect: ' . mysql_error());
Else echo "MySQL is configured correctly!";
mysql_close($link);
?>

Ubuntu 16.04 parses the PHP file as an empty page. How to solve this problem?
Ubuntu 16.04 parses the PHP file as an empty page. How to solve this problem?
View source code is still blank
Ubuntu 16.04 parses the PHP file as an empty page. How to solve this problem?
Moreover, the configuration of phpMyAdmin is not good all the time. Various installation methods have been tried
Ubuntu 16.04 parses the PHP file as an empty page. How to solve this problem?
Just started to contact lamp, looked up all kinds of materials, tried all kinds of methods that Baidu and Google can reach, but it has not been solved

4 Answers
Best Answer
Big fungus says answered 4 weeks ago

Friend, you can run php7 without knowing that MySQL has been removed in php7?
Mysqli is not recommended in PHP.
PDO recommended

Tide Walker replied 4 weeks ago

At the beginning of the contact, this PHP test code was also given by others. Do you mean the problem of this code? Is it out of date?

rebiekong answered 4 weeks ago

MySQL extension in php7 has been removed

charles answered 4 weeks ago

When encountering this kind of problem, the first thing I think about is to open the error log and let him report the error. Anyway, you are the development environment
Here is my PHP exception and error handling
Development environment php.ini
; display error
display_startup_errors = On
display_errors = On
; report all errors
error_reporting = -1
; record error
log_errors = On
Production environment php.ini
; do not display errors
display_startup_errors = Off
display_errors = Off
; report all errors except for some considerations
error_reporting = E_ALL & ~E_NOTICE
; record error
log_errors = On

zhenhong_liu answered 4 weeks ago

The PHP environment was not built successfully. PHP code is output directly. Modify the Apache configuration file.
Reference example:http://jingyan.baidu.com/article/fcb5aff797ec41edaa4a71c4.html