Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP conneting to MySQL give blank page on OpenSuSE 13.2 with MariaDB 10.0.20

Status
Not open for further replies.

appi

IS-IT--Management
Mar 17, 2003
296
0
0
CH
Hi all
I read many questions ans answers to this problem but nothing solve my.
First let me say that this code is running fine on our ASP. Only on my Test Box its resulting in a blank page
All Components (Apache2, PHP 5.6.1 and MariaDB 10.0.20) working fine. I can retrieve Data with phpMyAdmin or connect with user / passwd from config files
direct in mysql

We have two different filesets.
1.) which is also working is that the php-file calls a required variables.php which build the connectstring and do the connect to db.
2.) which is not working is that another php-file loads a php in subdirectory which retrieve the variables for connect from config.php from the root dir and prepare the connect which is used in many other scripts.

My question is now what I have to configure in php or apache to get it running on my SuSE Linux Box.
generally it will work - this is shown in case 1 But 95% is in case 2 and all is running at our ASP.

variablen.php
Code:
<?php
$db_server = "localhost";
$db_user = "db_user";
$db_pass = "db_pass";
$db_name = "db_name";

$db_connection = mysql_connect($db_server, $db_user, $db_pass);
$selected_db = mysql_select_db($db_name, $db_connection);

Code:
<?php
$db_server = "localhost";
$db_user = "db_user";
$db_pass = "db_pass";
$db_name = "db_name";

where can I look ? In error_log of apache is nothing reported.
thanks in advance
appi
 
Turn on Error Reporting for PHP, so instead of a white screen you get an explanatory error message.

At the top of your main PHP script:
Code:
error_reporting(E_ALL);
ini_set('display_errors', 1);

When developing you should set this in PHP.ini so its always on, and can catch fatal errors as well. The above code will only show non fatal errors. Since any fatal errors would prevent the code from being run.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
As it is not really a MySQL question

forum434

forum333

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
thanks vacunita

yes i have tried this. But same situation.
Only change was that I get the message "Deprecated mysql_connect()" but only if I cjange to use the variablen.php also in main scriptset.

This I switched off with error_reporting(E_ALL, ^E_DEPRECATED); - but than again blank page

@Chris - you are right, I have seen too late that my last reading was in MySQL, so better I have to post it in PHP I guess

appi
 
I will do the follow up now in PHP Forum because I have figured out that the Connect via Script works fine
The question is regarding differences between the working way of PHP 5.4.42 and 5.6.1 and mysql 5.1.73 and mariaDB 10.0.20

But I guess its more in the PHP site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top