Menu
ScriptAlias .php/ “c:/php”
AddType applications/x-httpd-php .php
Action application/x-httpd-php “/php/php.exe”
i put that in my httpd.cong file but now i dont know where to store my php files so i can test them on my localhost?
Begin by unzipping the Zip file to the directory of your choice. The usual location is c:PHP, and we will use this in the following explanation.
[list=1]
[*]In the main directory you will see a file called php.exe, and one called php4ts.dll. These are the files you will need to run PHP as a CGI. If you would like to run it as a SAPI module you will need to look in the directory c:PHPsapi and copy the relevant DLL file to C:PHP. If you are using Apache, the file is called php4apache.dll for example.
The SAPI modules are faster and easier to secure; the CGI version allows you to run PHP from the comamand line. Again, the choice is up to you.
[*]Copy the contents of c:PHPdlls to your Windows sytem directory. This will be c:winntsystem32 on Windows NT or 2000, or c:windowssystem32 on Windows XP.
[*]Move the directory c:PHPmibs to c:usrmibs.
[*]Set up a php.ini configuration file. PHP comes with two prepared files: php.ini-dist and php.ini-recommended. We suggest you use php.ini-recommended. Make a copy of thi sfile nad rename it php.ini. Place your php.ini file in the “%SYSTEM-ROOT%*#8221; directory. This is usually c:winnt or c:winnt40 on Windows NT or 2000, or c:windows on Windows XP.
[*]Edit your PHP ini file. There are many settings in it, most of which can be ignored for the time being. The settings you need to change now are
[list]
[*]Change the extension_dir directive to point to the directory where you extension DLLs reside. In the normal install this will be C:PHPextensions.
Your php.ini file will therefore contain
[FONT=courier new]extension_dir = c:/php/extensions[/FONT]
[*]Set the doc_root directive to point at the root directory that your Web sever serves from. This is likely to be
[FONT=courier new]doc_root = "c:/Program Files/Apache Group/Apache/htdocs/"[/FONT]
if you are using Apache, or
[FONT=courier new]doc_root = "c:/Inetpub/wwwroot"[/FONT]
if you are using IIS.
[*]You can also choose some extensions to run. We suggest at this stage that you just get PHP working; you can dll extensions as needed. In order to add an extension, just look at the list under “Windows Extensions*#8221;. You will see a lot of lines such as
[FONT=courier new];extension=php_pdf.dll[/FONT]
In order to turn this extension on, you can simple remove the semicolon at the start of the line (and do the opposite to turn it off). Note that if you want to add more extensions later, you should restart your Web server after you have changed [FONT=courier new]php.ini[/FONT] in order for the changes to take affect.
Close and save your [FONT=courier new]php.ini[/FONT] file.
[/list]
[*]If you are using NTFS, make sure the user that the Web server runs as has permission to read your php.ini file.
[/list]
[/quote]
[b]Setting your Path[/b]
MySQL comes with lots of command line utilities with varying degrees of usefulness. None of these are easy to get at unless the MySQL binary directory is in your [FONT=courier new]PATH[/FONT]. The purpose of this environment variable is to tell Windows where to look for executable programs.
Many of the common commands you use at the Windows command prompt, like [FONT=courier new]dir[/FONT] and [FONT=courier new]cd[/FONT], are interal and built into cmd.exe. Others, like [FONT=courier new]format[/FONT] and [FONT=courier new]ipconfig[/FONT], have their own executables. It would not be convenient to have to type C:WINNTsystem23format if you wanted to format a disk. It would not be convenient to have to type C:mysqlbinmysql to run the MySQL monitor.
The directory taht the executables for your basic Windowx commands, like format.exe, reside in is automatically in your PATH, so you can simple type format. In order to have the same convenience with the mysql command line tools, we need to add it.
Click Start, and choose Settings, Control Panel. Double-click System, and go to the Advanced tab. If you click the Environment Varibles button, you will be presented with a dialog box which allows you to view the environment variables for your system. Double-clicking PATH will allow you to edit it.
Add a semicolon to the end of your current path to separate your new entry from the previous one then add [FONT=courier new]c:mysqbinmysql[/FONT]. When you click OK, your addition will be stored in the machine's registry. Next time you restart the machine, you will be able to type [FONT=courier new]mysql[/FONT] rather than [FONT=courier new]C:mysqlbinmysql[/FONT].
[b]Deleting The Anonymous User[/b]
The default configuration of MySQL allows any user access the system without providing a username or password. This is obviously undesirable.
The first thing we want to do is delete the anonymous user. Opening a command prompt and typing the folowing lines will accomplish that.
[FONT=courier new]c:mysqlbinmysql[/FONT]
[FONT=courier new]use mysql[/FONT]
[FONT=courier new]delete from user where User='';[/FONT]
[FONT=courier new]quit[/FONT] [FONT=courier new]c:mysqlbinmysqladmin reload[/FONT]
The anonymouse user is now gone.
[b]Setting The Root Password[/b]
Even the superuser account, root, ahs no pasword yet. To set this user's password type in these lines
[FONT=courier new]c:mysqlbinmysqladmin -u root password your_password
c:mysqlbinmysqladmin -u root -h your_host_name password your_password[/font]
You should fine that tasks that previously required no username or password will now fail without this information. Attempting to run
[font=courier new]c:mysqlbinmysqladmin reload[/font]
or
[font=courier new]c:mysqlbinmysqladmin shutdown[/font]
will now fail.
From now on, you will need to use the [FONT=courier new]-u[/FONT] flag and provide a username, and the [FONT=courier new]-p[/FONT] flag to tell MySQL that you have a password, as in this example:
[FONT=courier new]c:mysqlbinmysqladmin -u root -p reload[/FONT]
If you type this command MySQL shoudl now prompt you for the root password that you just set.
If you ned more information, please refer to the MySQL Website,
[URL=http://www.mysql.com]http://www.mysql.com[/URL] .
[/quote]
[code=php]
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = ''; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password
[/code]
0.1.9 — BETA 5.27