higher PHP memory limit and database password

higher PHP memory limit and database password

by Jeff Mehring -
Number of replies: 14

Hi,

I am instlling Moodle, using Windows latest 18, and on the checking PHP settings it tells me I should increase my PHP memory limit. I tried to access my php.ini file but can't open it. Is there an easier way or should I contact my web hoster?

I also when confirming the database settings I can't seem to get the database name and password correct. I've used the database name and password I set up in MySQL database on the web hosting page but they don't seem to work.

Any ideas? Thanks,

Jeff

Average of ratings: -
In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Richard Enison -

JM,

  1. Is it possible you are confusing the database name with the database user name? You need both.
  2. What exactly do you mean by "they don't seem to work". Have you tried accessing the database directly, that is, outside of Moodle, e.g. with phpMyAdmin? Are you able to?

RLE

In reply to Richard Enison

Re: higher PHP memory limit and database password

by Jeff Mehring -

Hi RLE,

In moodle installation, the page where you need "to configure the database settings where most Moodle data will be stored". It automatically showed moodle as the database name, the user was root, and I needed to enter my database password. Is it ok to leave moodle as the database name? Is the database password the same as the password I set up the MySQL database with on my hosting server? Or must the database name be the same as the database name on MySQL hosting server? When I enter what I think is my database name and password I get the following error message: "Database creation error. Could not create the given database name with the settings provided". So my dilemma is the correct database name and password.

Thanks for the help,

Jeff

 

In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Richard Enison -

JM,

It is okay to leave the database name as moodle provided that is the name of the database you created using MySQL before running install.php. Yes, it must be the same as the MySQL database you created.

It is also okay to leave the user as root provided that is the MySQL user name you used when you created the database moodle. The Moodle docs on the database (http://docs.moodle.org/en/Installing_Moodle#Creating_an_empty_database) suggest that it might be okay to create the database as root for a test installation, but for security reasons this should not be done for a production installation of Moodle.

So in summary, the database name must be the same as the database you created in MySQL, the user must be the MySQL user that owns and has full rights to that database, and the password must be the MySQL password of that user.

RLE

In reply to Richard Enison

Re: higher PHP memory limit and database password

by Jeff Mehring -

RLE,

When I create a database on MySQL on the webserver, it only asks for a descrition, username and password. Under description I entered moodle, username was jeffm1 and then I entered the password and created the database. MySQL then shows the database name as jeffm1, description as moodle and the password is ok.

When I ran install.php and began the moodle installation I came to the page where you need to configure the database, the 3 webpage into the installation. It set up the type as MySQL, hostserver as localhost, database as moodle, user name was set to root, password was empty, and tables prefix was mdl_. When I entered jeffm1 as the database name and then my password it continues to come back with the error message "could not create the database with the information given. My problem seems to be the username root, which I don't know how to change. It will not let me change it on this page and from what I have read I need to change it in the config.php file, but I have not created that file yet because I have not completed the moodle installation. MySQL will not let me use root as the username to go around this problem.

This is my dilemma and I can not figure out how to get around it to complete the moodle installation.

Thanks for your help,

Jeff 

 

In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Richard Enison -

JM,

Having started to install the xampplite version of Moodle 1.8 I had downloaded a couple of weeks ago, I think I finally see what is going on, almost. A normal Moodle installation allows you to specify the type of database (mysql, postgresql, etc.), the database host, and the database user, in addition to the database name and password. But in the lite version, designed for testing on your own workstation, those three parameters are fixed as mysql, localhost, and root, as you said.

What is different is I was unable to create a database before starting the installation; you apparently did. I don't know whether that's because you know more about mysql than I do, or because you have the production version of mysql on your system. On my installation, I didn't need to, because Moodle automatically creates the database with the name and p/w I give it. At least, that's what it says.

Now if you already created a database with the same name as the one Moodle is trying to create, maybe that's the reason it is giving you the error. So my advice now is the opposite of what I said before: use a different name for the database than you used before, and see if that helps. surprise

Or maybe it's because you don't have the mysql service running.

RLE

In reply to Richard Enison

Re: higher PHP memory limit and database password

by Jeff Mehring -
RLE,

I did not create a database on Moodle before the installation. I did create a database on my server which has MySQL. I know less about MySQL than I do about Moodle, and I am really new to Moodle so I guess I got lucky there. It could be I don't have the MySQL running but I would never know if it is running or not. I know my computer is on! LOL!

So my question is, which version of Moodle makes it easier for new users to get started on? I also may be making things more difficult by trying to work Moodle on my webserver, should I be setting it up on my personal PC, then upload the files to Moodle? I have a Dell computer with Windows XP on it. I downloaded the Moodle that is for Windows, but maybe a general version would be better?

I tried to use a different database name and entered the possible passwords I have and nothing happened, I continue to get the same error. So then I tried different database names with the same password with the same results. I had a full head of hair when I began this process! LOL! I have the Moodle manual but it is not easy to follow for new users. It does jump around a lot.

Thanks for the help
Jeff
In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Richard Enison -

JM,

The reason I thought you might know more about MySQL than I is because of your statement in your previous post, which you have re-affirmed in this one, that you had created a database before starting the installation of Moodle. I don't know what you mean by you did not create a database on Moodle before the installation.

Anyway, the bottom line is, it looks like you are using a version of Moodle intended to be used on Windows workstations (like yours and mine; I too have a Dell with Windows XP) for testing and practice purposes (like xampplite), on your webserver. That, I think, is your main problem. I don't know how you created the database on the server before installing Moodle. As I said before, maybe you had MySQL software on the server before you installed xampplite, which comes with its own version of MySQL. Maybe the two MySQL servers are interfering with each other. Until we get all that cleared up, I don't see how I can help you with it.

As for whether it would be better to install (or at least download and unzip) Moodle on your workstation first and then upload to the server, I prefer to avoid that because it involves more downloading and uploading than necessary. As long as you are able to unzip on the server (which you have obviously done), I would say no, you don't need to do that.

If you intend to install Moodle on your webserver for production use, then I think you have the wrong version of Moodle for that purpose. To proceed further, it would be necessary to know more about your webserver, like what operating system it runs, the MySQL software, etc.

RLE

PS I did complete my xampplite Moodle installation on my PC, btw. I don't know how it managed to create the database when, as far as I could tell, the MySQL server was not running, but it evidently did, because my Moodle is working. Which is why I am puzzled by the fact that your Moodle installation has such a problem doing that, and why I suspect you have multiple copies of different kinds of MySQL servers on your web server interfering with each other.

In reply to Richard Enison

Re: higher PHP memory limit and database password

by Jeff Mehring -

RLE,

My webserver is GoDaddy.com and they have MySQL. I set up a database on that server before uploading Moodle to the webserver. Setting up the database on GoDaddy was easy, just input a database name and password and the database was created. So when I uploaded the Moodle files it must have created two databases, the one I had created on the webserver and then the one from Moodle using xampplite. So this could be a problem, the two databases are conflicting with each other causing the problem.   

The operating system and MySQL info is as follows:

Operating System
Red Hat Linux
Kernel
Version 2.4.21-4.0.1 elsmp
Web Server
Apache 1.3
Web Programming Languages
PHP 4.3.11
Tomcat (Java) 5.0.27
CGI / Perl 5.8
Python 2.2
FrontPage 5.0.2.5012
Databases
MySQL 4.0.24

I do wish to set up Moodle for production uses, not personal ones on my workstation only, but on a webserver. Which version of Moodle would work best with my webserver and Windows XP pc to run Moodle for production use?    

Congrats on getting your system working. It has really helped to understand my problems and work through them.

Thanks,

Jeff

In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Richard Enison -

JM,

OK, now we're getting somewhere (I think! mixed). This seems to confirm our suspicions about MySQL and raises some other possible problems.

  1. Not only is xampplite the wrong version of Moodle because it is for testing and practice on workstations, it is wrong because it is for Windows and you have a Linux server. Go ahead and use it on your Dell, but not the server.
  2. The version of MySQL you have has not been enough since Moodle 1.6. You will need to go back to Moodle 1.5 if you want to use it. Alternatively, ask GoDaddy to upgrade it (lots of luck!) or choose a different host. See http://moodle.org/mod/forum/discuss.php?d=53087#291165 to see how long GoDaddy has been an unsuitable host for the latest version of Moodle.
  3. Once again, I believe you are confusing a database server with a database. Did you actually create a database in MySQL or did you just activate MySQL itself? You can have many databases using MySQL (Moodle uses one, which you need to create before installing Moodle other than a lite version), each of which can have many tables (Moodle creates all the tables it needs, in the database you created, during the installation process).
  4. So you need to uninstall the xampplite version from the server and delete all the files and the database you created (if you really did!) and, if you want to continue with GoDaddy and they won't upgrade their MySQL server, download (http://docs.moodle.org/en/Installing_Moodle#Download_and_copy_files_into_place) and install Moodle 1.5 for Red Hat Linux. If you switch hosts, and your new host has the latest and greatest versions of php and MySQL, you can go with Moodle 1.8 if you want. Note that, in either case, if your host already has Apache, MySQL and PHP, you can download the Moodle-only package.

RLE

PS. There is a Moodle doc page just for Red Hat: http://docs.moodle.org/en/RedHat_Linux_installation

In reply to Richard Enison

Re: higher PHP memory limit and database password

by Jeff Mehring -

RLE,

Thanks for the help. I did come across some of the complaints for GoDaddy after setting up my domain, etc. Honestly, I think the easiest way to continue would be to find a new host/webserver. Any recommendations on who is best? Would like to use Moodle 1.8 with XAMPPlite if possible, but can switch. I have a MacBook, but the Moodle downloads for those are for production use.    

Jeff

In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Jeff Mehring -

RLE,

Have you looked at the web host provider Site Ground, www.siteground.com/moodle-hosting/htm ? It seems like a pretty easy site  to use and they set up the moodle for you. Do they have the proper requirements to run a Moodle? This is where I should start I think, to get used to Moodle, then later I can try to create my own. What do you think?

Jeff

 

In reply to Jeff Mehring

Re: higher PHP memory limit and database password

by Richard Enison -

JM,

I have seen nothing but positive comments about them in this forum, so It's probably worth a try. smile And I would think they meet the requirements, but you can ask them about the individual items (PHP version, etc.) and compare with the requirements listed in the Moodle docs.

Disclaimer: they are not listed as a Moodle Partner at moodle.com.

When you are ready to create your own production Moodle site, again, I strongly recommend not using xampplite. But go ahead and use it for practice on your Dell (but not your Mac).

RLE

In reply to Richard Enison

Re: higher PHP memory limit and database password

by Bettie Donovan -
Hi, I am looking to increase the PHP memory limit and the file upload size. Running Moodle 1.8.1 on an OS X server 10.4.9. I cannot locate the php.ini file to do this. Does anyone have any experience on the Mac side that can point me in the right direction? Thanks.
Bettie
In reply to Bettie Donovan

Re: higher PHP memory limit and database password

by Richard Enison -

BD,

I have used Macs, but not OS X and I have not installed Moodle on a Mac. I do know that OS X is a form of Unix or Linux and I have installed Moodle on Linux. More to the point, I know that you can find the location of your active php.ini file (you can have more than one in your file system but only one active php.ini) by running the phpinfo script. See http://docs.moodle.org/en/phpinfo. Its output tells you where your active php.ini file is. You might already have a phpinfo script in your Moodle (web) folder; if so, it is probably called phpinfo.php. If not, that would be the place to put it; you can call it what you want (as long as it isn't the same name as an existing file), but it must end ".php". Then run it by pointing your browser to it.

Look for "Configuration File (php.ini) Path" on the left side near the top of the output.

HTH

RLE