search
HomeBackend DevelopmentPHP TutorialPHP and mysql server configuration instructions

  1. zend_optimizer.optimization_level=15
  2. zend_extension_ts="d:php endoptimizer.dll"
  3. zendoptimizer.dll path must match
Copy code

Then look for extension_dir, and add the full name of your windirsystem32 directory at the end, for example: extension_dir = d:windowssystem32 (the last one must not be omitted!) Find extension=php_exif.dll, extension=php_imap.dll, extension=php_ldap.dll, extension=php_zlib.dll and remove the preceding semicolon comments. Find mysql.default_port and add your mysql port after the equal sign, for example: mysql.default_port = 3306 (3306 is the default port of mysql) Find mysql.default_host and add localhost after the equal sign, for example: mysql.default_host = localhost save Copy php.ini php.exe to the windows directory, and copy all .dll files under the php4ts.dll, dlls and extensions directories in php to windowssystem32 (do not overwrite existing files)

5. Configure apache server Open the apacheconfhttpd.conf file, the following are the main settings

  1. servertype standalone
  2. serverroot "d:/apache"
  3. # apache installation directory
  4. pidfile logs/httpd.pid
  5. scoreboardfile logs/apache_runtime_status
  6. timeout 300
  7. keepalive on
  8. maxkeepaliverequest s 100
  9. keepalivetimeout 15
  10. maxrequestsperchild 1024
  11. threadsperchild 50
  12. sendbuffersize 65536
  13. maxclients 150
  14. listen 80
  15. # Listen to port 80, default web server port
  16. bindaddress *
  17. # You can use web server at any IP
  18. loadmodule vhost_alias_module modules/mod_vhost_alias.so
  19. addmodule mod_v host_alias.c
  20. # Remove The # in front of these two lines turns on virtual domain name support
  21. port 80
  22. serveradmin me@localhost
  23. servername localhost
  24. # Port, administrator email, server domain name, modify according to actual situation
  25. documentroot "d:/myweb/"
  26. # web file Save the address, here is d:/myweb as an example
  27. options followsymlinks multiviews
  28. allowoverride all
  29. order allow,deny
  30. allow from all
  31. # Settings Access options for d:/myweb
  32. scriptalias /cgi-bin "e:/myweb/cgi"
  33. allowoverride none
  34. options none
  35. order allow,deny
  36. allow from all
  37. # Set cgi-bin directory permissions
  38. #!/perl/bin/perl
  39. # This line configures the running environment of perl-cgi. Since active perl is installed in d:perl, the relative value is used directly here. Path
  40. # Note that the first line of the cgi and pl files to be run must be the same as here, otherwise it cannot be run. It can also be written here as
  41. # #!d:/perl/bin/perl
  42. # In addition, the first # in this configuration does not mean a comment, so it cannot be omitted! !
  43. Find directoryindex index.html, add below
  44. directoryindex index.htm
  45. directoryindex default.htm
  46. directoryindex default.html
  47. directoryindex index.php
  48. directoryindex index.php3
  49. directoryindex index.cgi
  50. Find addtype application/x-httpd-php
  51. Modify to addtype application/x-httpd-php .php .phtml .php3
  52. Find addhandler cgi-script
  53. Modify to addhandler cgi-script .cgi .pl
  54. loadmodule php4_module d:/php/sapi/php4apache.dll
  55. loadmodule gzip_module d:/apache/modules/apachemodulegzip.dll
  56. # Load php4, gzip module
  57. ### The following are gzip module settings
  58. mod_gzip_on yes
  59. mod_gzip_minimum_file_size 300
  60. mod_gzip_maximum_file_size 0
  61. mod_gzip_maximum_inmem_size 100000
  62. mod_gzip_keep_workfiles no
  63. mod_gzip_dechunk yes
  64. mod_gzip_can_negotiate yes
  65. mod_gzip_temp_dir d :/apache/temp
  66. # There must be a temp directory under the apache directory. If not, create a new one
  67. mod_gzip_item_include file .html$
  68. mod_gzip_item_include file .htm$
  69. mod_gzip_item_include file .shtml$
  70. mod_gzip_item_include file .shtm$
  71. mod_ gzip_item_include file .pl $
  72. mod_gzip_item_include file .cgi$
  73. mod_gzip_item_include mime ^text/.*
  74. mod_gzip_item_include handler ^perl-script$
  75. mod_gzip_item_include mime ^httpd/unix-directory$
  76. mod_gzip_item_include handler ^server -status$
  77. mod_gzip_item_include handler ^server-info$
  78. mod_gzip_item_include mime ^application/x-httpd-php
  79. mod_gzip_item_include file .php$
  80. mod_gzip_item_include file .php3$
  81. mod_gzip_item_include file .mht$
  82. mod_gzip_item_exclude file .css$
  83. mod_gzip _item_exclude file .js$
  84. mod_gzip_item_exclude mime ^image/.*
  85. mod_gzip_item_exclude reqheader content-type:multipart/form-data
  86. mod_gzip_item_exclude reqheader content-type:application/x-www-form-urlencoded
  87. mod_gzip_item_exclude file attachment.php$
  88. #The above is a must for vbb
  89. ### end of mod_gzip sample config
  90. logformat "%h %l %u %t "%r" %>s %b mod_gzip: %{mod_gzip_result}n in:%{mod_gzip_input_size}n out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct. " mod_gzip_info
  91. # Record the running status of gzip
  92. # The above are the places that need to be added or modified in httpd.conf. Others do not need to be modified.
Copy the code

6. Configure phpmyadmin Open the config.inc.php file and modify it

  1. $cfgservers[1][''host''] = ''localhost''; //mysql address
  2. $cfgservers[1][''port''] = ''3306''; / /mysql port
  3. $cfgservers[1][''user''] = ''username''; //mysql username
  4. $cfgservers[1][''password''] = ''passwd''; // mysql password
  5. $cfgdefaultlang = ''zh''; //Configure phpmyadmin as a simplified Chinese interface
Copy code

Since phpmyadmin is a mysql configuration, it needs to be placed in a directory that others cannot guess or This directory requires user permission verification

7. Test If you follow the default d:mywebphpmyadmin, then use a browser to open the following address http://localhost/phpmyadmin/ If the test is successful, the mysql management page of phpmyadmin will appear. Click show php information, or go to http://localhost/phpmyadmin/phpinfo.php. This displays the configuration and operation of web php mysql.

As long as the configuration is OK, then the above apache 1.3.22 for win32+php 4.0.6+active perl 5.006001+zend optimizer v1.1.0+mod_gzip 1.3.19.1a+mysql 4.0.0 alpha Configuration completed.



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
Explain the concept of a PHP session in simple terms.Explain the concept of a PHP session in simple terms.Apr 26, 2025 am 12:09 AM

PHPsessionstrackuserdataacrossmultiplepagerequestsusingauniqueIDstoredinacookie.Here'showtomanagethemeffectively:1)Startasessionwithsession_start()andstoredatain$_SESSION.2)RegeneratethesessionIDafterloginwithsession_regenerate_id(true)topreventsessi

How do you loop through all the values stored in a PHP session?How do you loop through all the values stored in a PHP session?Apr 26, 2025 am 12:06 AM

In PHP, iterating through session data can be achieved through the following steps: 1. Start the session using session_start(). 2. Iterate through foreach loop through all key-value pairs in the $_SESSION array. 3. When processing complex data structures, use is_array() or is_object() functions and use print_r() to output detailed information. 4. When optimizing traversal, paging can be used to avoid processing large amounts of data at one time. This will help you manage and use PHP session data more efficiently in your actual project.

Explain how to use sessions for user authentication.Explain how to use sessions for user authentication.Apr 26, 2025 am 12:04 AM

The session realizes user authentication through the server-side state management mechanism. 1) Session creation and generation of unique IDs, 2) IDs are passed through cookies, 3) Server stores and accesses session data through IDs, 4) User authentication and status management are realized, improving application security and user experience.

Give an example of how to store a user's name in a PHP session.Give an example of how to store a user's name in a PHP session.Apr 26, 2025 am 12:03 AM

Tostoreauser'snameinaPHPsession,startthesessionwithsession_start(),thenassignthenameto$_SESSION['username'].1)Usesession_start()toinitializethesession.2)Assigntheuser'snameto$_SESSION['username'].Thisallowsyoutoaccessthenameacrossmultiplepages,enhanc

What are some common problems that can cause PHP sessions to fail?What are some common problems that can cause PHP sessions to fail?Apr 25, 2025 am 12:16 AM

Reasons for PHPSession failure include configuration errors, cookie issues, and session expiration. 1. Configuration error: Check and set the correct session.save_path. 2.Cookie problem: Make sure the cookie is set correctly. 3.Session expires: Adjust session.gc_maxlifetime value to extend session time.

How do you debug session-related issues in PHP?How do you debug session-related issues in PHP?Apr 25, 2025 am 12:12 AM

Methods to debug session problems in PHP include: 1. Check whether the session is started correctly; 2. Verify the delivery of the session ID; 3. Check the storage and reading of session data; 4. Check the server configuration. By outputting session ID and data, viewing session file content, etc., you can effectively diagnose and solve session-related problems.

What happens if session_start() is called multiple times?What happens if session_start() is called multiple times?Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

How do you configure the session lifetime in PHP?How do you configure the session lifetime in PHP?Apr 25, 2025 am 12:05 AM

Configuring the session lifecycle in PHP can be achieved by setting session.gc_maxlifetime and session.cookie_lifetime. 1) session.gc_maxlifetime controls the survival time of server-side session data, 2) session.cookie_lifetime controls the life cycle of client cookies. When set to 0, the cookie expires when the browser is closed.

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

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools