Elxis CMS Forum

Community => Elxis 2008.x Olympus (dev) => Topic started by: momo-i on January 09, 2008, 04:49:10

Title: Strange PHP error on Admin area
Post by: momo-i on January 09, 2008, 04:49:10
Hi all,

I'm rebuilding Elxis Japanese community site by Elxis 2008. A strange PHP error occurs unusually when I am working in the Admin area.
The same time error goes out for a while when this error occurs.
Afterwards, it is normally displayed when reload after a few menutes.

Quote
PHP: database::include(/home/elxis/includes/Core/../configuration.php) [function.database-include]: failed to open stream: No such file or directory
uri: index2.php?option=com_admin&task=tools&tname=updiag&act=patches
path:
version: Elxis 2008.0 Stable rev1817 [ Olympus-DEV ] 04-January-2008 11:36 GMT+2
WARNING(2): /home/elxis/includes/Core/database.php, line 165

Quote
PHP: database::include(/home/elxis/includes/Core/../offline.php) [function.database-include]: failed to open stream: No such file or directory
uri: index2.php?option=com_admin&task=tools&tname=updiag&act=patches
path:
version: Elxis 2008.0 Stable rev1817 [ Olympus-DEV ] 04-January-2008 11:36 GMT+2
WARNING(2): /home/elxis/includes/Core/database.php, line 166

system info
Quote
PHP Built On: Linux www.elxis.jp 2.6.23.1-49.fc8 #1 SMP Thu Nov 8 22:14:09 EST 2007 x86_64
Database Version: mysql 5.0.51-log (Version: 5.0.51)
PHP Version: 5.2.5
Web Server: Apache
Web Server to PHP interface: apache2handler
Version Elxis 2008.0 Stable rev1817 [ Olympus-DEV ] 04-January-2008 11:36 GMT+2
User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)
Relevant PHP Settings: Safe Mode: OFF
Open basedir: none
Display Errors: ON
Short Open Tags: ON
File Uploads: ON
Magic Quotes: ON
Register Globals: OFF
Output Buffering: OFF
Session save path: /tmp
Session auto start: 0 
XML enabled: Yes
Zlib enabled: Yes
Disabled Functions: none
WYSIWYG Editor: TinyMCE WYSIWYG Editor
 

Regars,
Title: Re: Strange PHP error on Admin area
Post by: datahell on January 09, 2008, 07:37:17
I have never seen such an error. Most probably something else is wrong and not the lines you posted.

Open /includes/Core/database.php
Go to the database function (around line 145).

Change this:
$basePath = dirname( __FILE__ );
include $basePath . '/../configuration.php';
include $basePath . '/../offline.php';

with this (3 times):
$basePath = str_replace( '/includes/Core', '', str_replace( DIRECTORY_SEPARATOR, '/', dirname(__FILE__) ) );
require_once($basePath.'/configuration.php');
require_once($basePath.'/offline.php');

Notice: This is not the problem. These files are included when no connection to the database can be established.
You should check the real reason for this problem. Did you checked the language files? I have never seen such an error. Does the same happens to you with the english language?
Title: Re: Strange PHP error on Admin area
Post by: momo-i on January 09, 2008, 08:24:40
Hi datahell,

Thank you for reply.

I see of the change in the code.
Before change in the code, I examine the condition that this error reproduces in detail.

Quote
Did you checked the language files?
Yes, Japanese language files are no problem.

Quote
Does the same happens to you with the english language?
I changed english,  no error has occurred. Then I chaned japanese again, but no error has occurred at present.

EDIT:
This error has occurred in english.
I will check on database server.


Regards,


Title: Re: Strange PHP error on Admin area
Post by: datahell on January 09, 2008, 21:24:11
OK momo-i it is due to a change in PHP 5.2. All versions until PHP 5.1 work fine.
Please report here the components/tasks that you saw this error in order to track down the problem and fix it for PHP 5.2

Copy-paste the URL of the error.
Title: Re: Strange PHP error on Admin area
Post by: datahell on January 10, 2008, 00:30:33
I just installed an Elxis 2008.0 with PHP 5.2.5 and I get no errors. Everything seems fine...
Title: Re: Strange PHP error on Admin area
Post by: momo-i on January 10, 2008, 01:29:49
Hmm...

I changed browser, Firefox, but same error has occurred. Then, I restarted httpd, then I lookup mysql.log

Quote
080110  8:20:51     442 Quit
                    469 Quit
                    530 Quit
------- this had 100 same lines -------
                    509 Quit
                    433 Quit
                    500 Quit
Is this correct?
Title: Re: Strange PHP error on Admin area
Post by: datahell on January 10, 2008, 08:08:26
If you don't tell me where exactly this error occurs I can not help. When the error occurs again copy-paste the url here. All the urls that causes errors.
Title: Re: Strange PHP error on Admin area
Post by: momo-i on January 10, 2008, 09:26:09
If you don't tell me where exactly this error occurs I can not help. When the error occurs again copy-paste the url here. All the urls that causes errors.

It is not occasionally done as time when it is not occurred by specific URL but any URL is occurred.

It is as follows of what occurred now.
visit: /administrator/index2.php?option=com_admin&task=tools&tname=updiag
above url's icon click: "Elxis CMS"
visit: /administrator/index2.php?option=com_banners

visit: /administrator/index2.php?option=com_admin&task=tools&tname=clean_cache
The error came to occur by all URL(front-end, back-end, login screen) when I executed "Clean cache" in tool while being writing this.


EDIT:
I changed the type of the database into Mysqli from Mysql.
Then, no error has occurred at present.
It will be because connection is closed normally, even if it verifies the log of Mysql.
(It seems to have not been closed normally when the type of a database is Mysql.)