search
HomeDatabaseMysql Tutorial配置服务器使它支持asp,cgi,php,mysql_MySQL


  iis5和pws都支持asp,然后你只要安装一个access就可以了。
  下面说说如何要他们支持cgi.
  
  1)pws下配置activePerl,使pws支持cgi程序
  
  要想在pws支持cgi,可以安装activeperl.步骤如下:
  
  首先在windows98下装好pws40(在windows光盘的add-ons目录里),然后下载activePerl,在http://www.activestate.com/,安装,建议装在c:\usr目录下,因为一般cgi程序第一行都要申明cgi解释程序的路径(#!/usr/bin/perl)。
  修改注册表
  找到: HKEY_LOCAL_MACHINE\System\Currentcontrlset\Services\W3svc\Parameters\ScriptMap\ 目录增加下面的键值:
    键名: ".cgi" 键值: "C:\USR\BIN\perl.exe %s %s"
    键名: ".pl" 键值: "C:\USR\BIN\perl.exe %s %s"
  接下来为PWS添加虚拟目录,(在个人web管理的高级选项里)目录别名为:CGI-BIN,把访问属性设为:执行,目录位置为本地硬盘的任何目录(CGI程序就存放在这个目录中)。
  设置都ok了,可以写个程序测试一下:
    写个test.cgi,放在CGI-BIN这个目录下,代码如下
    #!/usr/bin/perl
    print "Content-type:text/html\n\n";
    print "";
    print "hello,world!!!";
  
  在浏览器地址栏中键入http://你的ip/cgi-bin/test.cgi,如果在浏览器中显示:hello,world!!! 那就说明你的服务器配置成功了。
  
  2)IIS5.0下配置ActivePerl,使IIS5.0支持CGI程序。
  
  先安装好iis,在windows2k的删除添加程序里的windows组件里。然后下载最新版的Perl解释程序ActivePerl,很多地方都有,如华军软件园,也可以去http://www.activestate.com 安装,建议安装在c:/usr目录下。
  修改注册表
    找到: HKEY_LOCAL_MACHINE\System\Currentcontrlset\Services\W3svc\Parameters\ScriptMap\ 目录增加以下键值:
    键名: ".cgi" 键值: "C:\USR\BIN\perl.exe %s %s"
    键名: ".pl" 键值: "C:\USR\BIN\perl.exe %s %s"
  
  打开“Internet 服务管理器”,选中“默认web站点”或者其它站点,属性。在“web站点”页下,改变IP地址,原来是全部未分配,改成您机子的ip地址,例如:202.117.131.6,这个ip不要乱写啊,要不你的web就不能访问了。 可以写成127.0.0.1.“TCP端口”为“80”。接着,选中“主目录”页,单击“应用程序设置”下的“配置”按钮后,在新窗口下单击“添加”按钮,在“可执行文件”中输入“C:\usr\bin\perl.exe %s %s”,在“扩展名”中输入“.cgi”,把"脚本引擎"打上勾,点击“确定”(也可以添加其他的文件,如“.pl”等)。然后,选中“ISAPI筛选器”页,单击“添加”按钮;在“筛选器名称”中输入“cgi”,在“可执行文件”中输入“C:\usr\bin\PerlIS.dll”,点“确定”,这就完成了,你可以找个程序测试一下。下面来看看php的运行环境。
  
  
  3)配置php运行环境
  
  第一步还是下载最新版本的PHP解释程序。
  然后将压缩包解压到C:\PHP这个目录下.将“C:\php\dlls”目录下的所有文件复制到“c:\WinNT\System32(Winodws98系统为C:\Windows\System)” 目录下,有旧的文件存在就覆盖它。可能msvcrt.dll文件不能覆盖,可以忽略他。将C:\PHP\php.ini-dist这个文件改名为PHP.ini,复制到“C:\WinNT(Winodws98系统为C:\Windows)”目录下,并修改里面的内容,具体如下:
    找到“extension_dir = ”改为“extension_dir=c:/php/extensions”
  再稍微往下看,改成这个样子(一般默认是这样的):
    ;Windows Extensions
    ;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
    ;
    extension=php_bz2.dll
    extension=php_ctype.dll
    extension=php_cpdf.dll
    extension=php_curl.dll
    extension=php_cybercash.dll
    extension=php_db.dll
    extension=php_dba.dll
    extension=php_dbase.dll
    extension=php_domxml.dll
    extension=php_dotnet.dll
    extension=php_exif.dll
    extension=php_fdf.dll
    extension=php_filepro.dll
    extension=php_gd.dll
    extension=php_gettext.dll
    ;extension=php_ifx.dll
    extension=php_iisfunc.dll
    extension=php_imap.dll
    extension=php_interbase.dll
    extension=php_java.dll
    extension=php_ldap.dll
    extension=php_mhash.dll
    ;extension=php_mssql65.dll
    extension=php_mssql70.dll
    ;extension=php_oci8.dll
    extension=php_openssl.dll
    ;extension=php_oracle.dll
    extension=php_pdf.dll
    extension=php_pgsql.dll
    extension=php_printer.dll
    extension=php_sablot.dll
    ;extension=php_snmp.dll
    ;extension=php_sybase_ct.dll
    extension=php_yaz.dll
    extension=php_zlib.dll
  
  如果哪个库在运行时不正常,就在行首加上分号“;”.
  
  修改注册表
    在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map
  增加以下键值:
    键名: ".PHP" 键值: "C:\php\php.exe %s %s"
  
  打开"Internet 服务管理器",选"默认Web站点"的"属性",在"ISAPI筛选器"配置页下,添加一个新的筛选器,筛选器名称为PHP,可执行文件为php4isapi.dll文件的完整路径,如C:\php\sapi\php4isapi.dll;在"主目录"配置页下,按"配置"按钮打开"应用程序配置"窗口,添加一个应用程序映射项,可执行文件为php.exe,文件的完整路径如C:\PHP\php.exe,扩展名为.php(也可以改成别的,不过要注意您的PHP程序是要以它为后缀的),把"脚本引擎"打上勾。
  
  写一个程序测试吧,如:
    
  
  4)MySQL数据库
  先去下载MySQL数据库(ODBC)驱动程序和MySQL数据库系统程序。可以去mysql.com去找。
  
  安装MySQL数据库(ODBC)驱动程序(Windows9x系统下必须安装)
  
  安装MySQL数据库系统程序,一般安装在系统默认位置“C:\MySQL”,只不过这里要看你的实际情况。看是是作
  
  为数据库的专用主机,比如要建立几百个用户并有很多资料的话建议还是先选择比较大的分区,免得以后麻烦。
  
  执行“c:\MySQL\Bin\winmysqladmin.exe”来启动MySQL数据库系统和管理器,第一次启动时,系统会出现“快速设置”窗口,要求建立第一个数据库用户帐号。在User name中输入第一个MySQL数据库帐号,在Password中输入密码,记住输入的值,然后进入MySQL数据库管理窗口,过一会儿程序自动最小化窗口到系统的托架处(任务栏的右边有个“红绿灯”图标),系统已经正常启动(Windows2000用户要检查一下“组件服务管理器”中“MySQL组件服务”是否启动)。
  
  这时,程序还在启动组里添加了一个快捷方式,下次启动计算机就自动启动MySQL数据库系统。
  
  第一次启动数据库,系统就自动建立了名称为MySQL和test的两个数据库,你可以用以下的方法建立其它名称的数据库:
  
  右键单击系统托架“红绿灯”图标,单击“Show me”打开MySQL数据库管理窗口选择“Databases”标签——>选择数据库服务器——>右键单击一下——>选择“Create database”菜单项—>在弹出的添加数据库对话框中键入数据库名称(Database name)=>>单击“Create the datebase(创建这个数据库)”,一个新的数据库就建立了。
  
  帐号管理
  
  第一次启动数据库就建立了一个数据库用户帐号,如果你的服务器要让多个用户使用的话,就必须建立多个数据库用户帐号,步骤如下:
  
  启动“ODBC 数据源管理器”(WindowsNT/2k系统下“ODBC 数据源管理器”在“管理工具”里,Windows9x/me系统下“ODBC 数据源管理器”在“控制面板”里),在第一个标签“用户DSN”中单击“添加”按钮,在数据源驱动程序列表中选择“MySQL”,单击“完成”按钮,在“数据库驱动程序配置”对话框“Windows DSN name”中填入“网猫在线http://www.520cat.com”(意思是为网猫在线开的帐号),在MySQL host(Name or IP)填入服务器的主机名或者IP地址,在MySQL database name中填入数据库名称,在User中填入数据库帐号,在Password中填入密码,其它的可以为默认设置,单击“OK”。就建立了一个新的数据库帐号。
  
  现在可以调试一个程序试试。我就不多说了。
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are stored procedures in MySQL?What are stored procedures in MySQL?May 01, 2025 am 12:27 AM

Stored procedures are precompiled SQL statements in MySQL for improving performance and simplifying complex operations. 1. Improve performance: After the first compilation, subsequent calls do not need to be recompiled. 2. Improve security: Restrict data table access through permission control. 3. Simplify complex operations: combine multiple SQL statements to simplify application layer logic.

How does query caching work in MySQL?How does query caching work in MySQL?May 01, 2025 am 12:26 AM

The working principle of MySQL query cache is to store the results of SELECT query, and when the same query is executed again, the cached results are directly returned. 1) Query cache improves database reading performance and finds cached results through hash values. 2) Simple configuration, set query_cache_type and query_cache_size in MySQL configuration file. 3) Use the SQL_NO_CACHE keyword to disable the cache of specific queries. 4) In high-frequency update environments, query cache may cause performance bottlenecks and needs to be optimized for use through monitoring and adjustment of parameters.

What are the advantages of using MySQL over other relational databases?What are the advantages of using MySQL over other relational databases?May 01, 2025 am 12:18 AM

The reasons why MySQL is widely used in various projects include: 1. High performance and scalability, supporting multiple storage engines; 2. Easy to use and maintain, simple configuration and rich tools; 3. Rich ecosystem, attracting a large number of community and third-party tool support; 4. Cross-platform support, suitable for multiple operating systems.

How do you handle database upgrades in MySQL?How do you handle database upgrades in MySQL?Apr 30, 2025 am 12:28 AM

The steps for upgrading MySQL database include: 1. Backup the database, 2. Stop the current MySQL service, 3. Install the new version of MySQL, 4. Start the new version of MySQL service, 5. Recover the database. Compatibility issues are required during the upgrade process, and advanced tools such as PerconaToolkit can be used for testing and optimization.

What are the different backup strategies you can use for MySQL?What are the different backup strategies you can use for MySQL?Apr 30, 2025 am 12:28 AM

MySQL backup policies include logical backup, physical backup, incremental backup, replication-based backup, and cloud backup. 1. Logical backup uses mysqldump to export database structure and data, which is suitable for small databases and version migrations. 2. Physical backups are fast and comprehensive by copying data files, but require database consistency. 3. Incremental backup uses binary logging to record changes, which is suitable for large databases. 4. Replication-based backup reduces the impact on the production system by backing up from the server. 5. Cloud backups such as AmazonRDS provide automation solutions, but costs and control need to be considered. When selecting a policy, database size, downtime tolerance, recovery time, and recovery point goals should be considered.

What is MySQL clustering?What is MySQL clustering?Apr 30, 2025 am 12:28 AM

MySQLclusteringenhancesdatabaserobustnessandscalabilitybydistributingdataacrossmultiplenodes.ItusestheNDBenginefordatareplicationandfaulttolerance,ensuringhighavailability.Setupinvolvesconfiguringmanagement,data,andSQLnodes,withcarefulmonitoringandpe

How do you optimize database schema design for performance in MySQL?How do you optimize database schema design for performance in MySQL?Apr 30, 2025 am 12:27 AM

Optimizing database schema design in MySQL can improve performance through the following steps: 1. Index optimization: Create indexes on common query columns, balancing the overhead of query and inserting updates. 2. Table structure optimization: Reduce data redundancy through normalization or anti-normalization and improve access efficiency. 3. Data type selection: Use appropriate data types, such as INT instead of VARCHAR, to reduce storage space. 4. Partitioning and sub-table: For large data volumes, use partitioning and sub-table to disperse data to improve query and maintenance efficiency.

How can you optimize MySQL performance?How can you optimize MySQL performance?Apr 30, 2025 am 12:26 AM

TooptimizeMySQLperformance,followthesesteps:1)Implementproperindexingtospeedupqueries,2)UseEXPLAINtoanalyzeandoptimizequeryperformance,3)Adjustserverconfigurationsettingslikeinnodb_buffer_pool_sizeandmax_connections,4)Usepartitioningforlargetablestoi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor