php.ini memory ceiling & UTF-8 problems

php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -
Number of replies: 16

I've just signed up for a new hosting plan and wanted to intall the latest weekly build of Moodle. I made a MySQL database and added myself as a user.

When running the install script, my I can't get past the first two error checks: UTF-8 and the memory ceiling.

My server details are:

Apache version 2.2.17
PHP version 5.2.16
MySQL version 5.1.51

MySQL charset: UTF-8 Unicode (utf8) , specifically utf8_general_ci

I've put a php.ini file in the Moodle folder, with just one line:

php_value memory_limit = 100M

I'm not sure if that's right but it let me go past the initial warning of

Sorry, Moodle 2.0 requires at least 70MB of PHP memory.
Please contact server administrator to fix PHP.ini memory settings

I've uploaded the tarball straight to my /public_html directory, extracted it and ran the install script. There is nothing else on the account.

Can anyone point me in the right direction please? TIA smile

Guido

Average of ratings: -
In reply to Guido Gautsch

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Just a bit more info:

Server OS: unknown x86_64 Linux distro, running cPanel

Browser/OS: FF 3.6.13 on OS X 10.6.6

Moodle version: new install of moodle-latest-20.tgz

The .htaccess files in both my /root folder and /public_html are blank.

I've also attached my config.php and info.php files, hopefully with everything sensitive removed.

 

I found this bit of information on another forum:

I put a php.ini file in the moodle directory, and was able to run the moodle install script. It generated an error message further in, but I fixed that by adding an .htaccess file to apply the php.ini file to subdirectories within the moodle directory. I think it's going to work now.

I'm not sure how I'd go about doing that, but it may help me fix my memory limit problems.


My config.php:

<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'xxx';
$CFG->dbuser    = 'xxx';
$CFG->dbpass    = 'xxx';
$CFG->prefix    = 'xxx_';
$CFG->dboptions = array (
'dbpersist' => 0,
);

$CFG->wwwroot   = 'http://www.xxx.org/moodle';
$CFG->dataroot  = '/home/xxx/moodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

$CFG->passwordsaltmain = '>v}KK}>(;Dieb%O_?yE)!@ Ch,hI';

require_once(dirname(__FILE__) . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!

In reply to Guido Gautsch

Re: php.ini memory ceiling & UTF-8 problems

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mm maybe not... but worth a try. I would suggest there may be an issue with the cPAnel though. I would also suggest that the php.ini issue is not fixed.

You wrote:

I've put a php.ini file in the Moodle folder, with just one line:

php_value memory_limit = 100M

You are so close to solving this though. In your text editor, create a new file and add that line BUT remove the = sign. Save the file as .htaccess into your Moodle root folder, and do not forget to add the fullstop at the start of the file name - that is for the server to use.   Rename the php.ini file but do not delete it, you may need it. Redo the install,, clean everything out and do it again - and see if you can get through it without error. Chances are you wont, and that is possibly because cPanel is going to be interfering with your install. Do this first and see how you go - good luck.

 

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: php.ini memory ceiling & UTF-8 problems

by Georgy Qwoz -
Colin thank you very much! You help me a lot!
In reply to Colin Fraser

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Thanks very much for everyone's help...much appreciated! smile

I could set the charset in phpMyAdmin and now it passes the DB..the memory still isn't fixed, though. I tried the .htacess trick you mentioned without cleaning everyhting out and it gave me a 500 error. When you say Moodle root folder, do you mean in the /moodle folder or in the /publich_html folder? I've tried both, both of which result in a 500 error. Are you sure it is only supposed to say:

php_value memory_limit 100M

?

 

The /moodledata folder also contains a .htaccess file which says this:

deny from all
AllowOverride None
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory!

In reply to Guido Gautsch

Re: php.ini memory ceiling & UTF-8 problems

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm a bit confused... have you solved the memory issue or not? You said "it let me go past the initial warning" which would imply it's sorted.

The database problem is just the default character set with which you created the database. If you don't specify anything the default is normally 'latin1' which is no good. I have no idea how you do it with your cpanel but there should be an option for the default charset (needs to be utf8). Failing that a support call might be in order smile
Average of ratings: Useful (1)
In reply to Howard Miller

Re: php.ini memory ceiling & UTF-8 problems

by Colin Fraser -
Picture of Documentation writers Picture of Testers

I have been looking at the documentation for cPanel, and I suspect there is a serious problem. It seems, and I have found nothing that indicates the user has the opportunity to reset the default charset at any time during the DB creation process. It may be more appropriate to use the phpMyAdmin or phpPGAdmin to create the database, that will give you the opportunity to select a charset.

Average of ratings: Useful (1)
In reply to Howard Miller

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Hi Howard,

Well, I'm confused too. I can get past the initial warning of 'you need 70MB!' by placing a php.ini file in the /moodle folder that sets the limit to 100M. However, when I run the install script, it won't let me through! Very odd...

In reply to Guido Gautsch

Re: php.ini memory ceiling & UTF-8 problems

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Yes, but what does " it won't let me through!" look like?
In reply to Howard Miller

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Like the pic in the attachment (I just tried again from scratch, with the same php.ini file)

 

php_setting memory_limit PHP setting must be changed.PHP setting must be changed.

Insufficient memory detected, please set higher memory limit in PHP settings.

In reply to Guido Gautsch

Re: php.ini memory ceiling & UTF-8 problems

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Guido, using their .htaccess file, before the lines there, put in the memory_limit line and save it then try again, it should work and I do not understand if it is not. The features that are described in the .htaccess file are security measures that prevent someone hacking your site - well, an amatuer anyway.

In reply to Colin Fraser

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Hi Colin

That file is in the /moodledata folder. I added the line before it and the same thing happened (i.e. I failed the check). When I placed it in the /public_html folder I got the same server error again!!

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@guidosite.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I need a wall to bash my head against...sad

Thank you for your help though!

In reply to Colin Fraser

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Not trying to spam the forum but I remembered that I actually contact my webhost's support about this issue. This was their reply:

 

Hello Guido,

Thanks for writing in.

You can increase the memory_limit to 70 MB by editing / creating the
php.ini file within public_html and once the installation of Moodle 2.0
is done for your website, you can revert back the changes. As it is
shared server hence we do not recommend increasing the memory_limit as
it will cause the load on the host server and there are chances of your
account to be suspended.

Incase still if you face any problems then do get back to us with the
exact error message that you are getting along with the domain name in
question so that it will help us to investigate your issue further and
to assist you in a better way.

Please check the same at your end and feel free to contact us if you
have any further query or concern. We will be happy to assist you with it.

Regards,

Support

I'll contact them again and will get back to you with more joyous news smile

Cheers

Guido

In reply to Guido Gautsch

Re: php.ini memory ceiling & UTF-8 problems

by Colin Fraser -
Picture of Documentation writers Picture of Testers

ahh that makes sense, not sure if it will work though. Please follow their lead, and work with them, they may get more than a little annoyed if you just branch out on your own... And their view that they do not want to overload the server memory, which is, after all, their livelihood is not unreasonable. And I learned something new as well, good for you Guido and thanks.

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

I hope it will, otherwise I'll have to look for another host/hosting plan. Fingers crossed!

Thanks again for your help, Colin smile

In reply to Colin Fraser

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -
Here's the response from my webhost: Hello Guido, Thanks for the update. This issue has been fixed. I have increased the memory limit to 64M in custom php.ini and for whole public_html folder using following line in '.htaccess' under public_html directory. ----- SetEnv PHPRC /home/domainname/public_html/moodle -----! Please note that we can not increase it more than 64M as your account is hosted on shared environment. Now can proceed further to install Moodle as our server environment meets all minimum requirements. Please feel free to contact us if you require any further assistance. Yay! That's all it took smile Is 64MB enough though? It'll be a small site, but if 70MB is recommended as a minimum, I might run into trouble.
In reply to Howard Miller

Re: php.ini memory ceiling & UTF-8 problems

by Guido Gautsch -

Before placing the php.ini file in the /moodle folder, I got this message.

All .htacess files are blank.

PS: I'm using the FTP program CyberDuck to move files..not sure if that helps/matters