Build your own Database Driven Website using PHP & MySQL - Part 1: Installation

Just out of curiosity, is PHP available on tripod? I would hope so, but you never know. No reason why it shouldn’t work. What is the name of the file you uploaded to the server and what is the error you get? I’m trying to use telepathy, but it’s not working.

Just tried out Example 1.1 today. No problems. Running Win Xp & Apache Server 2.0.54.

The php was disregarded when upload to my (under construction) website at Tripod.com. Haven’t found out why yet.

Your instructions were easy to follow.

Thanks very much. Off to continue reading.

^-^ : Cass

I am following the tutorial that walks you throught the steps of how to install mysql and php. I have installed both and I am now at the step of :

To set a root password for MySQL, open a command prompt (or Terminal window) and type the following command in the bin directory of your MySQL installation:

mysql -u root mysql

Once I enter this into the terminal window, it says that there is no such command. I am running OSX 10.4. I have made sure that mysql server is running. Can you tell me what my problem is?

By Kevin Yank
October 5th 2004
Reader Rating: 9.2
Seems like this thing needs to be fixed…

Fully Usefull but a little paragraph to link to other how to do it thru others webbuilder tool like: Dreaweaver would be more great for already engaged non-php designer’s.

I am interested in this book and thought I would follow the first part that was free and if all works well, I get the book. I am new to all this and have had problems getting MySQL access. Pasted below, from mac installation,

To set a root password for MySQL, open a "command prompt (or Terminal window) and type the following command in the bin directory of your MySQL installation:

mysql -u root mysql"

I just get command not found when I add “mysql -u root mysql”, so I did not get very far. using mac, and terminal. Thanks for any feedback

I’ve got the book too, but am having problems in installing Apache. I have Windows ME but when I try the installation files I get "Internal Error 2735. ResolveServerName.

I was trying to set it all up on a local machine for testing/learning purposes etc.

Has anyone come accross this before?

I’ve got the 3rd Edition. I’ve worked through the installation chapter only to fail at the First PHP Script test: viewing the source code I see the <?php … ?> line.
I’ve gone back and double checked all the settings as explained in the book. I’ve restarted everything and still no joy. I’m running Windows XP Pro with IIS. Any ideas what I should do now?
:confused:

PS: forgot to mention I’ve loaded MySQL 5.0.17 and PHP 5.1.1

sardoman,

How are you loading the script in your browser? Make sure you’re typing the http://localhost/… URL into the address bar, and not opening the file in your browser with File > Open.

By typing http://localhost/today.php I got an error message: “Invalid access to memory location.” When I type the path to the file I have the problem in that where the date should be it is blank. I loaded the file onto my web server and it worked ok so I know it isn’t a syntax error.

Uninstall and try again? Thanks for the help

I’m waiting on my book to arrive in the mean time I’m using the e-book down load.I got to the part of making welcome1.html and welcome 1.php but when i click on the link in welcome1.html it presents a pop up to down load a zip file (which is wrong I know).when i click to open the zip file,it opens the text of the welcome.php file and not the browser page. does anyone know whats happening here.

I have a similar problem. When I click on the link in the welcome1.html I get presented with a dialog box to open or save the file. I am using PHP 5.2, with Apache 2.0.55 on Win2K

If your browser is offering you the PHP file as a download, and the download you receive contains the PHP code, this means that your web server has not been correctly configured to process PHP scripts before sending them as web pages to the browser.

You should go over the instructions in Chapter 1 again to make sure you followed all the steps. In particular, make sure you followed the section on editing httpd.conf to the letter, and that the resulting file was saved as httpd.conf, not httpd.conf.txt (as Notepad sometimes likes to do).

Just like to say that after a lot of hair pulling and shouting at the monitor all is working fine with Apache installed instead of IIS.

Onto the good stuff…

I’m having loads of troubles while trying to install Apache. I just need a few things straigtened out.

I’ve installed MySQL but waited on PHP until Apache was setup, but thinking I screwed it up, I just deleted the MySQL folder. When I thought Apache was up and running, I did everything I needed to do in order to install PHP, but when I realized Apache wasn’t working, I redid everything I did for the PHP and deleted that folder. Now I’m in a bind. I’ve reinstalled Apache (different versions and stuff) about 4 times now, without any useful help from the Apache.org documentation. Now, I feel like I’ve completely screwed up my computer by just removing Apache from my computer via Add & Remove programs and deleteing remaining files. I just want to install it right without screwing anything else up and so far I haven’t had a reply in the forum in which I posted my problem.

I am on a Windows XP (Pro, but I don’t want to use IIS) machine, with a copy of PHP 5.2.0, MySQL 5.0.27 win32, and the Apache 2.2.3 msi installer. If you can at least link to a straightfoward list of exactly what I need to do, that would be great. I love your article/book, but it jumps around from Windows to Unix to Mac too much too keep me focused on what I need to do. Just gets me confused.

I’ve spent the entire day trying to get this up and running, and honestly, it shouldn’t be too hard, should it?

Any help is very appreciated.

Also, when looking through the httpd.conf file when I was editing when I thought I had Apache running, I couldn’t find the line which said: “session.save_data” as the only ones I found were commented and just showing an example.

Hi Chronic,

I’ll be happy to walk you through the process, but rather than writing out all the instructions for you again, let’s follow the steps in the book. I’ll assume you’re working from the 3rd edition (“Latest Edition: June 2006” on the credits page), starting with the “Windows Installation” section on page 2.

Pages 2-4 step you through installing MySQL and modifying the my.ini file to use the old-passwords format for PHP compatibility.

Pages 4-5 talk you through downloading the correct version of PHP (the ZIP package), then setting up IIS. You can ignore the instructions for installing IIS, since you plan to use Apache.

Pages 5-6 give 4 steps that must be completed to install PHP on your system before configuring your web server to use it. In particular, this involves copying two vital files to your Windows SYSTEM32 folder and a third file (php.ini) to your main Windows folder. You must then edit the php.ini file to modify session.save_path (not edit httpd.conf to modify session.save_data, as your post asked).

Next, you need to download and install Apache, and then verify that it is running on your system by attempting to load http://localhost/ in your browser.

Then you can follow the steps on pages 9-10 to configure Apache to work with your copy of PHP.

With that done, skip over the Linux and Mac OS X instructions to page 21, where you’re guided through a few final tasks: set a MySQL root password, double-check a couple of settings in your php.ini file, and then restart Apache (which you can do in Windows using the shortcuts that the installation added to your Start menu).

Now, obviously you’re having trouble with one of these steps. If you follow these steps exactly, let me know precisely when something happens that you don’t expect, and which might indicate a problem. Tell me what you expected to happen, and what happened instead. I should be able to assist you from there.

First off, reading through your post, it pointed out a mistake I made. In my post, I mentioned I was looking for a line in the httpd.conf file when infact it was php.ini as your post pointed out. I still didn’t find it (using ctrl+f).

Also, I’ll have to work through it tomorrow as it is late here and should be going to get some sleep. I’m sure that if I follow them correctly in order again and just double check what I am doing, I should be able to get it.

Thanks again. :slight_smile: However, if Apache doesn’t work again, what is a good resource to troubleshoot it? I haven’t had a good look through the help file that comes with Apache in the start menu, so i’m not sure if it’s in there.

What is the exact string you’re searching for? In your question, you indicated you were searching for session.save_data, when in my message I pointed out it’s actually session.save_path you should be looking for.

Thanks again. :slight_smile: However, if Apache doesn’t work again, what is a good resource to troubleshoot it?

The best way to troubleshoot Apache is to launch it from the command prompt so you can see any error messages. I’ll talk you through that if it’s required.

Okay, I got MySQL and Apache working, but now I’m still having one small issue with PHP.

I am looking for the following string in php.ini: session.save_path, however, I only find 4 tokens, all are commented out.

I find:

; session.save_path = “N;/path”

; session.save_path = “N;MODE;/path”

;session.save_path = “/tmp”

; (see session.save_path above), then garbage collection does not

Those are the only ones that use that phrase.

Any ideas? (PHP 5.2.0)

The third one is the one you’re supposed to uncomment (by removing the semicolon) and then adjust the value of to suit your system. In previous versions of PHP, this line was not commented by default. I’ll make a note to update the book accordingly.