问题
I have this user already..alive and kicking in the 3 main tables i.e jos_user, and other 2 acro_ and acro_map...of the joomla i get this error when i use the contact button from a component...
Below is the error:
JUser::_load: Unable to load user with id: 160529
Error loading Modules:MySQL server has gone away SQL=SELECT m.*, am.params as adv_params FROM jos_modules as m LEFT JOIN jos_advancedmodules as am ON am.moduleid = m.id WHERE m.published = 1 AND m.access <= 1 AND m.client_id = 0 ORDER BY m.ordering, m.id
Please do not worry about the other Error (since i m trying to find a solution for that frm hosting provider) but at the moment i am seriously clueless about unable to load user in this joomla component when i use the Contact us button
Code for the 'View' of the component ::
defined('_JEXEC') or die('Restricted access');
$to = "";
$subject = "";
$message = "";
$Itemid = JRequest::getInt('Itemid');
$to = $this->msgSendInfo[0];
$subject = $this->msgSendInfo[1];
$message = $this->msgSendInfo[2];
$document =& JFactory::getDocument();
$document->addScriptDeclaration($this->script);
$document->addScriptDeclaration($this->users);
?>
<!-- Title -->
<div class="fsl_h3title"><b><?php echo JText::_('JBJOBS_NEWMESSAGE'); ?></b></div>
<!--<div runat="server" ID="divContent" class="border" contenteditable="true">
<?php echo $message; ?>
</div>-->
<!-- Begin Form for message -->
<form action="index.php" method="post" name="adminForm" id="adminForm" >
<div class="col100">
<table class="admintable jbj_tblborder" width="100%">
<tr>
<td width="100" align="right" class="key">
<label for="to">
<?php echo JText::_( 'JBJOBS_TO' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="to" id="to" size="32" maxlength="100" value="<?php echo $to; ?>" onkeyup="return getUser()" readonly />
<!--<select id="toList" style="width: 200px; float: left; margin-left: 8px; vertical-align: middle;" onchange="return setUser()" size="2">
<option><?php echo JText::_( 'JBJOBS_NOSUGGESTIONS' ); ?></option>
</select>-->
</td>
</tr>
<tr>
<td width="100" align="right" class="key">
<label for="subject">
<?php echo JText::_( 'JBJOBS_SUBJECT' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="subject" id="subject" size="48" maxlength="100" value="<?php echo $subject; ?>" />
</td>
</tr>
<tr>
<td width="100" align="right" class="key">
<label for="message">
<?php echo JText::_( 'JBJOBS_MESSAGE' ); ?>:
</label>
</td>
<td>
<?php
$editor =& JFactory::getEditor();
echo $editor->display('message', $message, '500', '300', '60', '10', true);
?>
</td>
<!-- Do NOT remove these two input boxes -->
<input type='hidden' id='temp' />
<input type='hidden' id='temp2' />
</tr>
<tr>
<td width="100" align="right" class="key">
<label for="submit">
</label>
</td>
<td>
<input class="button" type="submit" name="submit" id="submit" size="32" maxlength="100" value="<?php echo JText::_( 'JBJOBS_SEND' ); ?>" />
</td>
</tr>
</table>
</div>
<div class="clr"></div> <!-- Clears the float -->
<!-- Do not edit after this point, it does not change the visual style -->
<input type="hidden" name="option" value="com_jbjobs" />
<input type="hidden" name="task" value="savemessage" />
<input type="hidden" name="controller" value="jbmessaging" />
<input type="hidden" name="Itemid" id="Itemid" value="<?php echo $Itemid; ?>" />
<?php
jimport('joomla.utilities.date');
$now = new JDate();
$date = $now->toMySQL();
$user =& JFactory::getUser();
?>
<input type="hidden" name="date" value="<?php echo $date; ?>" />
<input type="hidden" name="idFrom" value="<?php echo $user->id; ?>" />
<input type="hidden" name="<?php echo JUtility::getToken(); ?>" value="1" />
</form>
<script type='text/javascript'>
<!--
getUser();
//-->
</script>
Edit : A note from my host provide ( final blow to the hard-work past 6 months )
Thank you for contacting. The problem it seems to be with a huge joomla user table:
# 1267920 users in jos users"
ls -laSh /var/lib/mysql/_final1
total 868M
-rw-rw---- 1 mysql mysql 452M May 2 04:51 jos_jbjobs_jobseeker.MYD
-rw-rw---- 1 mysql mysql 155M May 2 16:47 jos_users.MYD
-rw-rw---- 1 mysql mysql 120M May 2 16:47 jos_users.MYI
-rw-rw---- 1 mysql mysql 45M May 2 04:51 jos_core_acl_aro.MYD
-rw-rw---- 1 mysql mysql 36M May 2 08:30 jos_core_acl_aro.MYI
-rw-rw---- 1 mysql mysql 25M May 2 04:51 jos_core_acl_groups_aro_map.MYD
-rw-rw---- 1 mysql mysql 13M May 2 08:30 jos_jbjobs_jobseeker.MYI
joomla is limit itself per 64M memory limit
when you clicking this form below:
Components ? Contacts ? new Contacts
due to a huge amount of user:
Linked User. The username this contact is linked to (if applicable).
throwing the below error of 64M limitation
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 76 bytes) in /home/ink/public_html/libraries/joomla/database/database/mysql.php on line 462
the actual consumption of memory in this case is a lot more than 1G. So it's not like a server issue is more like a joomla issue itself and apparently joomla is not design for so many users. Let us know if you have any other questions or concerns.
So i guess joomla perhaps cannot handle 1 million or 5 million users?
回答1:
The error message implies that MySQL hasn't returned from you query
Error loading Modules:MySQL server has gone away
- this could be a query execution timing out
- PHP running out of time
- or either running out memory.
Your user id indicates a large number of users - is your server up to the job?
[EDIT] The error you've just added is a PHP error, it is saying that you've exhausted the memory that PHP is Allowed to use, not Joomla!. By the way what version of Joomla! are you using? With this many users I would be tending to use a MySQLi which should be slightly faster and more efficient. Looking at the indicated line in the error message you appear to be on 1.5.x
To check your PHP settings in Joomla! go to Help->System Info->PHP Information
and then do a find on memory_limit
to find out what your servers PHP configuration is. Going on the error message it's 64 Mbs. Your host should know this by the way...
[EDIT 2]
By the way, no where in the Joomla! code base does it do an ini_set('memory_limit', '64M')
or similar, infact apart from a few calls to check the memory_limit
using ini_get('memory_limit')
I couldn't find anything in the Joomla core setting a memory limit.
来源:https://stackoverflow.com/questions/10405981/juser-load-unable-to-load-user-although-the-user-exists-in-all-3-main-joomla