当前位置: 编程技术>php
本页文章导读:
▪测试您的 PHP 水平的题目
在 Unix Review 上看到这个很有意思的测试,和大家共享。 UnixReview.com May 2007 Test Your Knowledge of PHP by Emmett Dulaney From: http://www.unixreview.com/documents/s=10130/ur0705d/ Increasingly, PHP seems to be.........
▪Discuz板块横排显示图片的实现方法
到你目前在使用的模板中寻找 discuz.htm 找到这一段代码: 代码如下:<td width="$cat[forumcolwidth]" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'"> .........
▪Win2003下IIS+PHP+MySQL+Zend配置步骤详解第1/2页
一、软件的获取 1.php首先去http://www.php.net/downloads.php下载最新的PHP 5.2.0版本。 2.MySQL可以在http://dev.mysql.com/downloads/mysql/5.0.html#downloads下载到最新的5.0.xx版本。 3.Zend Optimizer可以去http://www.zend.........
[1]测试您的 PHP 水平的题目
来源: 互联网 发布时间: 2013-11-30
在 Unix Review 上看到这个很有意思的测试,和大家共享。
UnixReview.com
May 2007
Test Your Knowledge of PHP
by Emmett Dulaney
From: http://www.unixreview.com/documents/s=10130/ur0705d/
Increasingly, PHP seems to be the tool/language that is used to make Web sites dynamic. While it is far from the only open source scripting language available, PHP's abilities and features are quickly making it not only a must-have in the Web world but also a topic on many certification exams. Following are fifty questions on PHP at the knowledge level found on beginning/intermediate certification exams. Good luck (answers are at the end of the article)!
1. What is the closing tag used by a PHP-driven web page?
A. />
B. #>
C. ?>
D. .>
2. Which PHP conditional operator means the values are equal AND of the same data type?
A. ==
B. ||
C. ===
D. ==?
3. Which of the following statements is true regarding variables in PHP (choose two)?
A. Variable names in PHP are case sensitive.
B. Variable names in PHP are not case sensitive.
C. PHP variables need to be declared before they can be used.
D. PHP variables do not need to be declared before they can be used.
4. You are evaluating a script written by a previous employee. That script contains a require statement that causes the script to exit when an error occurs. You want to change this so the script will generate a warning when such an error occurs, but keep on running. What should you replace require with?
A. involve
B. need
C. include
D. call_for
5. Which of the following does not represent a comment in a PHP script?
A. // This is a comment
B. <?comment This is a comment />
C. # This is a comment
D. /* This is a comment */
6. Which escape character in PHP renders a linefeed?
A. \n
B. \r
C. \t
D. \\
7. What file is used to configure global PHP settings? ______________ (Fill in the blank.)
8. If the value of $AU is currently 7, what is its value as a result of the command $AU++;
A. 8
B. 9
C. 14
D. 49
9. Which printf type specifier is used for a floating point value?
A. d
B. f
C. s
D. u
10. Which PHP logical operator is used to see if both a and b are true?
A. a & b
B. a && b
C. a | b
D. a || b
11. If an array holds 100 entries, which identifier signifies the first entry?
A. 100
B. 99
C. 1
D. 0
12. What function must be called to send the random number generator before array_rand()?
A. limit()
B. scope()
C. srand()
D. hinum()
13. Which two choices below represent the default order resulting from a sort utilizing asort()?
A. A-Z
B. Z-A
C. 0-9
D. 9-0
14. Which of the following is not true for variable names?
A. They can contain an underscore character
B. They can begin with a numeric character
C. They can begin with an alpha character
D. They can contain alphanumeric characters
15. What is the opening tag used on a PHP-driven web page?
A. <?php
B. <php
C. </php
D. <P
16. What are used to separate blocks of statements within a control structure?
A. brackets [ ]
B. parentheses ( )
C. curly braces { }
D. quotation marks ""
17. Which function can be used to assign a data type to a variable?
A. assign
B. assigntype
C. settype
D. type
18. Which HTTP variable contains the IP address of the machine making a request?
A. ADDR_IP
B. ADDR
C. IP_ADDR
D. REMOTE_ADDR
19. You are creating a simple form for web users to send you a message. Which method should be used with that form?
A. POST
B. GET
C. SEND
D. READ
20. Within your PHP script, you are performing a division operation on two variables. What data type is assigned to the division result, by default, if it is a fractional result?
A. integer
B. double
C. string
D. Boolean
21. Which mode of the fopen() function opens a file for reading or writing, maintains exiting content, and places the file pointer at the beginning of the file?
A. w
B. a
C. r+
D. w+
22. Which function can be used to copy a file?
A. copy()
B. clone()
C. rename()
D. repr()
23. Which of the following is used to set a cookie to expire 24 hours from now?
A. $cookie_expire = time() +24
B. $cookie_expire = time() +1440
C. $cookie_expire = time() +86400
24. Which character is used as a statement terminator to indicate the end of a PHP command?
A. =
B. #
C. |
D. ;
25. Which of the following commands will initialize the $days array?
A. $days = ()
B. $days = array();
C. $days = ""
D. $days = initialize [ ]
E. 12345
F. 12,3,45
G. 1{2,3,4}5
26. What function can be used to see if a file exists?
A. file()
B. file_there()
C. exist_file()
D. file_exists()
27. To create a cookie, your code uses the following entry: SetCookie ("user", "Emmett Dulaney", time() +1800); Which of the following is the best to use to see the value "Emmett Dulaney"?
A. $user
B. $COOKIE[user]
C. $_COOKIE[user]
D. $COOKIE_user
28. Which of the following should be used to combine two or more existing arrays?
A. array_add()
B. array_merge()
C. array_join()
D. array_combine()
29. What function is used to determine whether a session has been started for the current user and then start one if necessary? __________ (Fill in the blank.)
30. After opening a file with the fopen() function, what is used to close the file pointer?
A. fclose()
B. close()
C. die()
D. end()
31. Which of the following functions can be used to show the data type for the $remain variable?
A. echo show($remain);
B. echo gettype($remain);
C. echo type($remain);
D. echo explain($remain);
32. Which of the following functions removes a directory from a file system?
A. rmdir()
B. dir()
C. del()
D. dir_gone()
33. What is the difference between sleep() and usleep()?
A. sleep() suspends operations and usleep() resumes them
B. sleep() accepts seconds and usleep() accepts milliseconds
C. sleep() works for the current process and usleep() works for all processes
D. sleep() can only be specified for the current user and usleep() can be specified for all users
34. You need to know how many elements are in an array. What function should you use to count this?
A. list()
B. count()
C. number()
D. sizeof()
35. Information about a session, by default, is configured in the PHP configuration file to be saved beneath which directory?
A. /var
B. /etc
C. /tmp
D. /usr
36. Which of the following contains variables provided to a script by means of the server environment?
A. $_FILES
B. $_POST
C. $_GET
D. $_ENV
37. Which of the following can be used to delete a file?
A. delete()
B. rid()
C. unlink()
D. close()
38. Which of the following functions can be used to destroy a variable?
A. erase
B. fi
C. remove
D. unset
39. Which mode of the fopen() function opens a file for writing and places the file pointer at the end of the file?
A. w
B. a
C. r+
D. w+
40. Which HTTP variable contains the browser type, and browser version, among other values?
A. BROWSE_AGENT
B. BROWSER_TYPE
C. BROWSER_ENV
D. HTTP_USER_AGENT
41. If the current value of $bsns is 4400, what is the new value as a result of this command: $bsns -= 150;
A. -150
B. 150
C. 4250
D. 4400
E. 4550
F. "4400-150"
42. What are used to enclose conditional expressions?
A. brackets [ ]
B. parentheses ( )
C. curly braces { }
D. quotation marks " "
43. Which PHP data type can be either TRUE or FALSE?
A. Truth
B. Integer
C. Boolean
D. Float
44. Which of the following contains variables provided to a script by means of file uploads?
A. $_FILES
B. $_POST
C. $_GET
D. $_ENV
45. Which constant identifies the highest random number that the system can generate?
A. URAND
B. END_NUMBER
C. ULIMIT
D. RAND_MAX
46. PHP provides support for POSIX through functions of which class?
A. grep
B. ereg
C. psx
D. efgrp
47. From a Boolean standpoint, every zero value in PHP is considered:
A. True
B. False
C. Error
D. Null
48. Which function places results in the opposite order of asort()?
A. arsort()
B. rev()
C. trosa()
D. zsort()
49. Which printf type specifier is used for a string?
A. d
B. f
C. s
D. u
50.Which PHP conditional operator means not equal to?
A. !=
B. =!
C. <=>
D. <>
Answers
1. The closing tag used by PHP is ?>. Answer: C.
2. The PHP conditional operator of three equal signs (===) means the values are equal and of the same data type. Answer: C.
3. PHP variable names are case sensitive and variables do not need to be declared before they can be used. Answer: A and D.
4. The include instruction will create a warning, but allow the script to continue running when an error is encountered. Answer: C.
5. There are at least three ways to create comments in a PHP script, and <comment is not one of them. Answer: B.
6. The \n escape character in PHP renders a linefeed. Answer: A.
7. The global configuration file is php.ini.
8. The command $AU++; increments the variable by one – changing it from 7 to 8. Answer: A.
9. The printf type specifier f is used for a floating point value. Answer: B.
10. The PHP logical operator to use to see if both a and b are true would be a && b. Answer: B.
11. The first entry is 0, the second is 1, and the numbers increment from there. Answer: D.
12. The srand() function must be called to send the random number generator before array_rand(). Answer: C.
13. The default order resulting from a sort utilizing asort() is alphabetic (A-Z) and lowest to highest (0-9). Answer: A and C.
14. Variable names cannot begin with a numeric character. Answer: B.
15. The opening tag used by PHP is <?php. Answer: A.
16. Curly braces are used to separate blocks of statements within a control structure. Answer: C.
17. The settype function can be used to assign a data type to a variable. Answer: C.
18. The REMOTE_ADDR HTTP variable contains the IP address of the machine making a request. Answer: D.
19. The POST method should be used for a form as described. Answer: A.
20. If the result is not a whole number, it is assigned the double data type If it is a whole number, integer is assigned. Answer: B.
21. The r+ mode of the fopen() function opens a file for reading or writing, maintains exiting content, and places the file pointer at the beginning of the file. Answer: C.
22. The copy() function can be used to copy a file. Answer: A.
23. To set a cookie to expire 24 hours from now, compute the number of seconds and use the time() function: $cookie_expire = time() +86400. Answer: C.
24. The semicolon character (;) is used as a statement terminator to indicate the end of a PHP command. Answer: D.
25. The command $days = array(); will initialize the $days array. Answer: B.
26. The file_exists() function can be used to see if a file by the given name is already in existence. Answer: D.
27. The value of $_COOKIE[user] is equal to what was set in the cookie. Answer: C.
28. The array_merge() function should be used to combine two or more existing arrays. Answer: B.
29. The function to use is session_start()
30. After opening a file with the fopen() function, fclose() is used to close the file pointer. Answer: A.
31. The gettype function can be used to show the data type for a variable. Answer: B.
32. The rmdir() function removes a directory from a file system. Answer: A.
33. sleep() accepts seconds and usleep() accepts milliseconds. Answer: B.
34. The sizeof() function can tell how many elements are in an array Answer: D.
35. Information about a session, by default, is configured in the PHP configuration file to be saved beneath /tmp. Answer: C.
36. $_ENV contains variables provided to a script by means of the server environment. Answer: D.
37. The unlink() function can be used to delete a file. Answer: C.
38. The unset function can be used to destroy a variable. Answer: D.
39. The "a" mode of the fopen() function opens a file for writing and places the file pointer at the end of the file. Answer: B.
40. The HTTP_USER_AGENT HTTP variable contains the browser type, and browser version, among other values. Answer: D.
41. This operation subtracts 150 from the existing value. Answer: C.
42. Parentheses are used to enclose conditional expressions. Answer: B.
43. The Boolean PHP data type can be either TRUE or FALSE. Answer: C.
44. $_FILES contains variables provided to a script by means of file uploads. Answer: A.
45. The RAND_MAX constant identifies the highest random number that a system can generate. Answer: D.
46. PHP provides support for POSIX through functions of the ereg class. Answer: B.
47. From a Boolean standpoint, every zero value in PHP is considered false. Answer: B.
48. The arsort() function places results in the opposite order of asort(). Answer: A.
49. The printf type specifier s is used for a string. Answer: C.
50. The != PHP conditional operator means not equal to. Answer: A.
Emmett Dulaney is the author of the several books on Linux/Unix and certification as well as a columnist for UnixReview.com. Emmett's blog can be found at: http://edulaney.blogspot.com, and he can be reached (and welcomes your comments) at: edulaney@insightbb.com.
UnixReview.com
May 2007
Test Your Knowledge of PHP
by Emmett Dulaney
From: http://www.unixreview.com/documents/s=10130/ur0705d/
Increasingly, PHP seems to be the tool/language that is used to make Web sites dynamic. While it is far from the only open source scripting language available, PHP's abilities and features are quickly making it not only a must-have in the Web world but also a topic on many certification exams. Following are fifty questions on PHP at the knowledge level found on beginning/intermediate certification exams. Good luck (answers are at the end of the article)!
1. What is the closing tag used by a PHP-driven web page?
A. />
B. #>
C. ?>
D. .>
2. Which PHP conditional operator means the values are equal AND of the same data type?
A. ==
B. ||
C. ===
D. ==?
3. Which of the following statements is true regarding variables in PHP (choose two)?
A. Variable names in PHP are case sensitive.
B. Variable names in PHP are not case sensitive.
C. PHP variables need to be declared before they can be used.
D. PHP variables do not need to be declared before they can be used.
4. You are evaluating a script written by a previous employee. That script contains a require statement that causes the script to exit when an error occurs. You want to change this so the script will generate a warning when such an error occurs, but keep on running. What should you replace require with?
A. involve
B. need
C. include
D. call_for
5. Which of the following does not represent a comment in a PHP script?
A. // This is a comment
B. <?comment This is a comment />
C. # This is a comment
D. /* This is a comment */
6. Which escape character in PHP renders a linefeed?
A. \n
B. \r
C. \t
D. \\
7. What file is used to configure global PHP settings? ______________ (Fill in the blank.)
8. If the value of $AU is currently 7, what is its value as a result of the command $AU++;
A. 8
B. 9
C. 14
D. 49
9. Which printf type specifier is used for a floating point value?
A. d
B. f
C. s
D. u
10. Which PHP logical operator is used to see if both a and b are true?
A. a & b
B. a && b
C. a | b
D. a || b
11. If an array holds 100 entries, which identifier signifies the first entry?
A. 100
B. 99
C. 1
D. 0
12. What function must be called to send the random number generator before array_rand()?
A. limit()
B. scope()
C. srand()
D. hinum()
13. Which two choices below represent the default order resulting from a sort utilizing asort()?
A. A-Z
B. Z-A
C. 0-9
D. 9-0
14. Which of the following is not true for variable names?
A. They can contain an underscore character
B. They can begin with a numeric character
C. They can begin with an alpha character
D. They can contain alphanumeric characters
15. What is the opening tag used on a PHP-driven web page?
A. <?php
B. <php
C. </php
D. <P
16. What are used to separate blocks of statements within a control structure?
A. brackets [ ]
B. parentheses ( )
C. curly braces { }
D. quotation marks ""
17. Which function can be used to assign a data type to a variable?
A. assign
B. assigntype
C. settype
D. type
18. Which HTTP variable contains the IP address of the machine making a request?
A. ADDR_IP
B. ADDR
C. IP_ADDR
D. REMOTE_ADDR
19. You are creating a simple form for web users to send you a message. Which method should be used with that form?
A. POST
B. GET
C. SEND
D. READ
20. Within your PHP script, you are performing a division operation on two variables. What data type is assigned to the division result, by default, if it is a fractional result?
A. integer
B. double
C. string
D. Boolean
21. Which mode of the fopen() function opens a file for reading or writing, maintains exiting content, and places the file pointer at the beginning of the file?
A. w
B. a
C. r+
D. w+
22. Which function can be used to copy a file?
A. copy()
B. clone()
C. rename()
D. repr()
23. Which of the following is used to set a cookie to expire 24 hours from now?
A. $cookie_expire = time() +24
B. $cookie_expire = time() +1440
C. $cookie_expire = time() +86400
24. Which character is used as a statement terminator to indicate the end of a PHP command?
A. =
B. #
C. |
D. ;
25. Which of the following commands will initialize the $days array?
A. $days = ()
B. $days = array();
C. $days = ""
D. $days = initialize [ ]
E. 12345
F. 12,3,45
G. 1{2,3,4}5
26. What function can be used to see if a file exists?
A. file()
B. file_there()
C. exist_file()
D. file_exists()
27. To create a cookie, your code uses the following entry: SetCookie ("user", "Emmett Dulaney", time() +1800); Which of the following is the best to use to see the value "Emmett Dulaney"?
A. $user
B. $COOKIE[user]
C. $_COOKIE[user]
D. $COOKIE_user
28. Which of the following should be used to combine two or more existing arrays?
A. array_add()
B. array_merge()
C. array_join()
D. array_combine()
29. What function is used to determine whether a session has been started for the current user and then start one if necessary? __________ (Fill in the blank.)
30. After opening a file with the fopen() function, what is used to close the file pointer?
A. fclose()
B. close()
C. die()
D. end()
31. Which of the following functions can be used to show the data type for the $remain variable?
A. echo show($remain);
B. echo gettype($remain);
C. echo type($remain);
D. echo explain($remain);
32. Which of the following functions removes a directory from a file system?
A. rmdir()
B. dir()
C. del()
D. dir_gone()
33. What is the difference between sleep() and usleep()?
A. sleep() suspends operations and usleep() resumes them
B. sleep() accepts seconds and usleep() accepts milliseconds
C. sleep() works for the current process and usleep() works for all processes
D. sleep() can only be specified for the current user and usleep() can be specified for all users
34. You need to know how many elements are in an array. What function should you use to count this?
A. list()
B. count()
C. number()
D. sizeof()
35. Information about a session, by default, is configured in the PHP configuration file to be saved beneath which directory?
A. /var
B. /etc
C. /tmp
D. /usr
36. Which of the following contains variables provided to a script by means of the server environment?
A. $_FILES
B. $_POST
C. $_GET
D. $_ENV
37. Which of the following can be used to delete a file?
A. delete()
B. rid()
C. unlink()
D. close()
38. Which of the following functions can be used to destroy a variable?
A. erase
B. fi
C. remove
D. unset
39. Which mode of the fopen() function opens a file for writing and places the file pointer at the end of the file?
A. w
B. a
C. r+
D. w+
40. Which HTTP variable contains the browser type, and browser version, among other values?
A. BROWSE_AGENT
B. BROWSER_TYPE
C. BROWSER_ENV
D. HTTP_USER_AGENT
41. If the current value of $bsns is 4400, what is the new value as a result of this command: $bsns -= 150;
A. -150
B. 150
C. 4250
D. 4400
E. 4550
F. "4400-150"
42. What are used to enclose conditional expressions?
A. brackets [ ]
B. parentheses ( )
C. curly braces { }
D. quotation marks " "
43. Which PHP data type can be either TRUE or FALSE?
A. Truth
B. Integer
C. Boolean
D. Float
44. Which of the following contains variables provided to a script by means of file uploads?
A. $_FILES
B. $_POST
C. $_GET
D. $_ENV
45. Which constant identifies the highest random number that the system can generate?
A. URAND
B. END_NUMBER
C. ULIMIT
D. RAND_MAX
46. PHP provides support for POSIX through functions of which class?
A. grep
B. ereg
C. psx
D. efgrp
47. From a Boolean standpoint, every zero value in PHP is considered:
A. True
B. False
C. Error
D. Null
48. Which function places results in the opposite order of asort()?
A. arsort()
B. rev()
C. trosa()
D. zsort()
49. Which printf type specifier is used for a string?
A. d
B. f
C. s
D. u
50.Which PHP conditional operator means not equal to?
A. !=
B. =!
C. <=>
D. <>
Answers
1. The closing tag used by PHP is ?>. Answer: C.
2. The PHP conditional operator of three equal signs (===) means the values are equal and of the same data type. Answer: C.
3. PHP variable names are case sensitive and variables do not need to be declared before they can be used. Answer: A and D.
4. The include instruction will create a warning, but allow the script to continue running when an error is encountered. Answer: C.
5. There are at least three ways to create comments in a PHP script, and <comment is not one of them. Answer: B.
6. The \n escape character in PHP renders a linefeed. Answer: A.
7. The global configuration file is php.ini.
8. The command $AU++; increments the variable by one – changing it from 7 to 8. Answer: A.
9. The printf type specifier f is used for a floating point value. Answer: B.
10. The PHP logical operator to use to see if both a and b are true would be a && b. Answer: B.
11. The first entry is 0, the second is 1, and the numbers increment from there. Answer: D.
12. The srand() function must be called to send the random number generator before array_rand(). Answer: C.
13. The default order resulting from a sort utilizing asort() is alphabetic (A-Z) and lowest to highest (0-9). Answer: A and C.
14. Variable names cannot begin with a numeric character. Answer: B.
15. The opening tag used by PHP is <?php. Answer: A.
16. Curly braces are used to separate blocks of statements within a control structure. Answer: C.
17. The settype function can be used to assign a data type to a variable. Answer: C.
18. The REMOTE_ADDR HTTP variable contains the IP address of the machine making a request. Answer: D.
19. The POST method should be used for a form as described. Answer: A.
20. If the result is not a whole number, it is assigned the double data type If it is a whole number, integer is assigned. Answer: B.
21. The r+ mode of the fopen() function opens a file for reading or writing, maintains exiting content, and places the file pointer at the beginning of the file. Answer: C.
22. The copy() function can be used to copy a file. Answer: A.
23. To set a cookie to expire 24 hours from now, compute the number of seconds and use the time() function: $cookie_expire = time() +86400. Answer: C.
24. The semicolon character (;) is used as a statement terminator to indicate the end of a PHP command. Answer: D.
25. The command $days = array(); will initialize the $days array. Answer: B.
26. The file_exists() function can be used to see if a file by the given name is already in existence. Answer: D.
27. The value of $_COOKIE[user] is equal to what was set in the cookie. Answer: C.
28. The array_merge() function should be used to combine two or more existing arrays. Answer: B.
29. The function to use is session_start()
30. After opening a file with the fopen() function, fclose() is used to close the file pointer. Answer: A.
31. The gettype function can be used to show the data type for a variable. Answer: B.
32. The rmdir() function removes a directory from a file system. Answer: A.
33. sleep() accepts seconds and usleep() accepts milliseconds. Answer: B.
34. The sizeof() function can tell how many elements are in an array Answer: D.
35. Information about a session, by default, is configured in the PHP configuration file to be saved beneath /tmp. Answer: C.
36. $_ENV contains variables provided to a script by means of the server environment. Answer: D.
37. The unlink() function can be used to delete a file. Answer: C.
38. The unset function can be used to destroy a variable. Answer: D.
39. The "a" mode of the fopen() function opens a file for writing and places the file pointer at the end of the file. Answer: B.
40. The HTTP_USER_AGENT HTTP variable contains the browser type, and browser version, among other values. Answer: D.
41. This operation subtracts 150 from the existing value. Answer: C.
42. Parentheses are used to enclose conditional expressions. Answer: B.
43. The Boolean PHP data type can be either TRUE or FALSE. Answer: C.
44. $_FILES contains variables provided to a script by means of file uploads. Answer: A.
45. The RAND_MAX constant identifies the highest random number that a system can generate. Answer: D.
46. PHP provides support for POSIX through functions of the ereg class. Answer: B.
47. From a Boolean standpoint, every zero value in PHP is considered false. Answer: B.
48. The arsort() function places results in the opposite order of asort(). Answer: A.
49. The printf type specifier s is used for a string. Answer: C.
50. The != PHP conditional operator means not equal to. Answer: A.
Emmett Dulaney is the author of the several books on Linux/Unix and certification as well as a columnist for UnixReview.com. Emmett's blog can be found at: http://edulaney.blogspot.com, and he can be reached (and welcomes your comments) at: edulaney@insightbb.com.
[2]Discuz板块横排显示图片的实现方法
来源: 互联网 发布时间: 2013-11-30
到你目前在使用的模板中寻找 discuz.htm
找到这一段代码:
<td width="$cat[forumcolwidth]" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'">
<a href="/blog_article/forumdisplay/fid/$forum[fid].html"><span >$forum[name]</span></a><br>
<span ><div >{lang forum_threads}: $forum[threads]</div><div >{lang forum_posts}: $forum[posts]</div><div >{lang forum_todayposts}: $forum[todayposts]</div></span>
</td>
修改为:
<td >$forum[folder]</td>
<td width="$cat[forumcolwidth]" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'">
$forum[icon]<a href="/blog_article/forumdisplay/fid/$forum[fid].html"><span >$forum[name]</span></a><br>
<span >$forum[description]</span><br>
<!--{if $forum['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if is_array($forum['lastpost'])}-->
<a href="/blog_article/redirect/tid/$forum[lastpost][tid]/amp;goto/lastpost.html" title="$forum[lastpost][dateline]" >
{lang forum_lastpost_in}: {$forum[lastpost][subject]}</a>
{lang forum_lastpost_by}<!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
<!--{else}-->
{lang never}
<!--{/if}-->
<!--{/if}--></td>
找到这一段代码:
代码如下:
<td width="$cat[forumcolwidth]" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'">
<a href="/blog_article/forumdisplay/fid/$forum[fid].html"><span >$forum[name]</span></a><br>
<span ><div >{lang forum_threads}: $forum[threads]</div><div >{lang forum_posts}: $forum[posts]</div><div >{lang forum_todayposts}: $forum[todayposts]</div></span>
</td>
修改为:
代码如下:
<td >$forum[folder]</td>
<td width="$cat[forumcolwidth]" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'">
$forum[icon]<a href="/blog_article/forumdisplay/fid/$forum[fid].html"><span >$forum[name]</span></a><br>
<span >$forum[description]</span><br>
<!--{if $forum['permission'] == 1}-->
{lang private_forum}
<!--{else}-->
<!--{if is_array($forum['lastpost'])}-->
<a href="/blog_article/redirect/tid/$forum[lastpost][tid]/amp;goto/lastpost.html" title="$forum[lastpost][dateline]" >
{lang forum_lastpost_in}: {$forum[lastpost][subject]}</a>
{lang forum_lastpost_by}<!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
<!--{else}-->
{lang never}
<!--{/if}-->
<!--{/if}--></td>
[3]Win2003下IIS+PHP+MySQL+Zend配置步骤详解第1/2页
来源: 互联网 发布时间: 2013-11-30
一、软件的获取
1.php首先去http://www.php.net/downloads.php下载最新的PHP 5.2.0版本。
2.MySQL可以在http://dev.mysql.com/downloads/mysql/5.0.html#downloads下载到最新的5.0.xx版本。
3.Zend Optimizer可以去http://www.zend.com/free_download/optimizer下载最新的3.X.X版本。
4.phpmyadmin可以到http://www1.skycn.com/soft/17470.html下载2.9.2版。
二、软件的安装
1.将得到的php压缩包文件解压到D:\php\php5目录
2.定义Windows系统path环境变量,在我的电脑->属性->高级->环境变量->系统变量->找到path这个变量,点击编辑,在其后面加入安装php的路径,如D:\php\php5,注意每一个变量之间有一个“;”半角的分号分隔,如果前面的没有分号自己手工加上去。然后确定。
若不采用配置环境变量的方法,可以使用复制.dll文件到系统目录下,效果相同。将D:\php\php5下的所有.dll后缀的文件都复制到C:\Windows\system32目录下即可。
3.为 PHP 设置一个有效的配置文件,php.ini。
在 ZIP 包中有两个 ini 文件,php.ini-dist 和 php.ini-recommended。建议使用 php.ini-recommended,因为在该文件中优化了性能和安全。因为它从 php.ini-dist 修改而来,会对设置产生较大的影响。例如将 display_errors 设置为 off,将 magic_quotes_gpc 设置为 off。如果想要最安全的设置,这是最好的方法,虽然 PHP 在默认配置下也是很安全的。
先将D:\PHP\php5\php.ini-recommended 重命名为 php.ini 。再用记事本打开 php.ini :
register_globals = Off 把off改成On (有二处)此处一般能解决运行论坛安装时出现空白的问题。
short_open_tag = Off 把off改成On 。
extension_dir = "./" 改为extension_dir = "D:\php\php5\ext" (指定动态连接库的目录,php5和php4不同的地方就是它的动态连接库目录变了,这在它的文档结构里有详细的说明)
extension=php_mbstring.dll 这个不选的话用phpMyAdmin会出现红色提示
extension=php_dba.dll
extension=php_dbase.dll
extension=php_gd2.dll 支持GD库的,一般要滴
extension=php_imap.dll 可选
extension=php_ldap.dll
extension=php_mysql.dll 支持MySQL的
接下来修改了一些文件上传以及内存使用最大限制:
memory_limit = 20M 脚本运行最大消耗的内存容量
post_max_size = 20M 闪存容量
upload_max_filesize = 20M 附件容量
max_input_time = 60 这是每个脚本可以消耗的时间,单位也是秒
max_execution_time = 30 这个是每个脚本运行的最长时间,可以自己修改加长,单位秒
upload_tmp_dir 上传文件存放的临时路径,如:D:\php\tmp\upload_tmp
session.save_path 缓存文件路径,如:D:\php\tmp\session_save
4.使php.ini在windows下可以使用
我的电脑->属性->高级->环境变量->系统变量->点击“添加”->变量名“PHPRC”->变量值“D:\PHP;”也就是你安装PHP的路径。
5.配置IIS,使其支持php。
在控制面板〉添加/删除程序中正确安装IIS6。
PHP 支持 CGI 和 ISAPI 两种安装模式,CGI 更消耗资源,容易因为超时而没有反映,但是实际上比较安全,负载能力强,节省资源,但是安全性略差于CGI,本人推荐使用 ISAPI 模式。故这里只解介绍 ISAPI 模式安装方法:
在“你需要支持PHP的Web站点”比如“默认Web站点”上单击右键选择“属性”,在打开的“ Web 站点属性”“主目录”选项卡,编辑或者添加PHP的扩展名映射即可或者将你步需要支持PHP的站点中的PHP扩展映射删除即可,“可执行文件”添加D:\php\php5目录下的php5isapi.dll,扩展名是.php。动作限制为“GET,HEAD,POST,TRACE”,再添加一个后缀名为.php3的isapi扩展,其他设置同.php扩展的。
再打开“站点属性”窗口的“文档”选项卡,找到并点击“添加”按钮,向默认的 Web 站点启动文档列表中添加 index.php 项。您可以将 index.php 升到最高优先级,这样,访问站点时就会首先自动寻找并打开 index.php 文档。
确定 Web 目录的应用程序设置和执行许可中选择为纯脚本,然后关闭 Internet 信息服务管理器
对于2003系统还需要在“Internet 服务管理器”左边的“WEB服务扩展”中添加一个以.php为扩展名的isapi,设置路径为D:\php\php5\php5isapi.dll,设置状态为允许,Active Server Pages 允许。
均安装完成后重起服务器,然后在 IIS 根目录下新建一个文本文件存为 php.php ,内容如下:
<?php
phpinfo();
?>
打开浏览器,输入:http://localhost/php.php,将显示当前服务器所支持 PHP 的全部信息,可以看到 Server API的模式为:ISAPI
三、安装MySQL
直接在MySQL官方下载好mysql压缩包后,解压双击setup.exe安装,Next下一步后选择Custom自定义安装,再Next下一步选择安装路径这里我们选择D:\MySQL,继续Next下一步Skip Sign UP完成安装。
安装完成后会提示你是不是立即进行配置,选择是即可进行配置。当然一般安装后菜单里面也有配置向导MySQL Server Instance Config Wizar,运行后按下面步骤配置并设置ROOT密码即可Next下一步后选择Standard Configuration,Next下一步,钩选Include .. PATH,Next下一步,设置ROOT密码,建议社设置复杂点,确保服务器安全!Apply完成后将在D:\MySQL目录下生成MY.INI配置文件,添加并启动MySQL服务。
四、安装Zend Optimizer
下载后得到 ZendOptimizer,直接双击安装即可,安装过程要你选择 Web Server 时,选择 IIS ,然后提示你是否 Restart Web Server,选择是,完成安装之前提示是否备份 php.ini ,点确定后安装完成。我这里安装到D:\php\Zend
Zend Optimizer 的安装向导会自动根据你的选择来修改 php.ini 帮助你启动这个引擎。下面简单介绍一下 Zend Optimizer 的配置选项。以下为本人安装完成后 php.ini 里的默认配置代码(分号后面的内容为注释):
zend_extension_ts="D:\php\Zend\lib\ZendExtensionManager.dll"
;Zend Optimizer 模块在硬盘上的安装路径。
zend_extension_manager.optimizer_ts="D:\php\Zend\lib\Optimizer-2.6.2"
;优化器所在目录,默认无须修改。
zend_optimizer.optimization_level=1023
;优化程度,这里定义启动多少个优化过程,默认值是 15 ,表示同时开启 10 个优化过程中的 1-4 ,我们可以将这个值改为 1023 ,表示开启全部10个优化过程。
调用phpinfo()函数后显示:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies 则表示安装成功。
1.php首先去http://www.php.net/downloads.php下载最新的PHP 5.2.0版本。
2.MySQL可以在http://dev.mysql.com/downloads/mysql/5.0.html#downloads下载到最新的5.0.xx版本。
3.Zend Optimizer可以去http://www.zend.com/free_download/optimizer下载最新的3.X.X版本。
4.phpmyadmin可以到http://www1.skycn.com/soft/17470.html下载2.9.2版。
二、软件的安装
1.将得到的php压缩包文件解压到D:\php\php5目录
2.定义Windows系统path环境变量,在我的电脑->属性->高级->环境变量->系统变量->找到path这个变量,点击编辑,在其后面加入安装php的路径,如D:\php\php5,注意每一个变量之间有一个“;”半角的分号分隔,如果前面的没有分号自己手工加上去。然后确定。
若不采用配置环境变量的方法,可以使用复制.dll文件到系统目录下,效果相同。将D:\php\php5下的所有.dll后缀的文件都复制到C:\Windows\system32目录下即可。
3.为 PHP 设置一个有效的配置文件,php.ini。
在 ZIP 包中有两个 ini 文件,php.ini-dist 和 php.ini-recommended。建议使用 php.ini-recommended,因为在该文件中优化了性能和安全。因为它从 php.ini-dist 修改而来,会对设置产生较大的影响。例如将 display_errors 设置为 off,将 magic_quotes_gpc 设置为 off。如果想要最安全的设置,这是最好的方法,虽然 PHP 在默认配置下也是很安全的。
先将D:\PHP\php5\php.ini-recommended 重命名为 php.ini 。再用记事本打开 php.ini :
register_globals = Off 把off改成On (有二处)此处一般能解决运行论坛安装时出现空白的问题。
short_open_tag = Off 把off改成On 。
extension_dir = "./" 改为extension_dir = "D:\php\php5\ext" (指定动态连接库的目录,php5和php4不同的地方就是它的动态连接库目录变了,这在它的文档结构里有详细的说明)
extension=php_mbstring.dll 这个不选的话用phpMyAdmin会出现红色提示
extension=php_dba.dll
extension=php_dbase.dll
extension=php_gd2.dll 支持GD库的,一般要滴
extension=php_imap.dll 可选
extension=php_ldap.dll
extension=php_mysql.dll 支持MySQL的
接下来修改了一些文件上传以及内存使用最大限制:
memory_limit = 20M 脚本运行最大消耗的内存容量
post_max_size = 20M 闪存容量
upload_max_filesize = 20M 附件容量
max_input_time = 60 这是每个脚本可以消耗的时间,单位也是秒
max_execution_time = 30 这个是每个脚本运行的最长时间,可以自己修改加长,单位秒
upload_tmp_dir 上传文件存放的临时路径,如:D:\php\tmp\upload_tmp
session.save_path 缓存文件路径,如:D:\php\tmp\session_save
4.使php.ini在windows下可以使用
我的电脑->属性->高级->环境变量->系统变量->点击“添加”->变量名“PHPRC”->变量值“D:\PHP;”也就是你安装PHP的路径。
5.配置IIS,使其支持php。
在控制面板〉添加/删除程序中正确安装IIS6。
PHP 支持 CGI 和 ISAPI 两种安装模式,CGI 更消耗资源,容易因为超时而没有反映,但是实际上比较安全,负载能力强,节省资源,但是安全性略差于CGI,本人推荐使用 ISAPI 模式。故这里只解介绍 ISAPI 模式安装方法:
在“你需要支持PHP的Web站点”比如“默认Web站点”上单击右键选择“属性”,在打开的“ Web 站点属性”“主目录”选项卡,编辑或者添加PHP的扩展名映射即可或者将你步需要支持PHP的站点中的PHP扩展映射删除即可,“可执行文件”添加D:\php\php5目录下的php5isapi.dll,扩展名是.php。动作限制为“GET,HEAD,POST,TRACE”,再添加一个后缀名为.php3的isapi扩展,其他设置同.php扩展的。
再打开“站点属性”窗口的“文档”选项卡,找到并点击“添加”按钮,向默认的 Web 站点启动文档列表中添加 index.php 项。您可以将 index.php 升到最高优先级,这样,访问站点时就会首先自动寻找并打开 index.php 文档。
确定 Web 目录的应用程序设置和执行许可中选择为纯脚本,然后关闭 Internet 信息服务管理器
对于2003系统还需要在“Internet 服务管理器”左边的“WEB服务扩展”中添加一个以.php为扩展名的isapi,设置路径为D:\php\php5\php5isapi.dll,设置状态为允许,Active Server Pages 允许。
均安装完成后重起服务器,然后在 IIS 根目录下新建一个文本文件存为 php.php ,内容如下:
<?php
phpinfo();
?>
打开浏览器,输入:http://localhost/php.php,将显示当前服务器所支持 PHP 的全部信息,可以看到 Server API的模式为:ISAPI
三、安装MySQL
直接在MySQL官方下载好mysql压缩包后,解压双击setup.exe安装,Next下一步后选择Custom自定义安装,再Next下一步选择安装路径这里我们选择D:\MySQL,继续Next下一步Skip Sign UP完成安装。
安装完成后会提示你是不是立即进行配置,选择是即可进行配置。当然一般安装后菜单里面也有配置向导MySQL Server Instance Config Wizar,运行后按下面步骤配置并设置ROOT密码即可Next下一步后选择Standard Configuration,Next下一步,钩选Include .. PATH,Next下一步,设置ROOT密码,建议社设置复杂点,确保服务器安全!Apply完成后将在D:\MySQL目录下生成MY.INI配置文件,添加并启动MySQL服务。
四、安装Zend Optimizer
下载后得到 ZendOptimizer,直接双击安装即可,安装过程要你选择 Web Server 时,选择 IIS ,然后提示你是否 Restart Web Server,选择是,完成安装之前提示是否备份 php.ini ,点确定后安装完成。我这里安装到D:\php\Zend
Zend Optimizer 的安装向导会自动根据你的选择来修改 php.ini 帮助你启动这个引擎。下面简单介绍一下 Zend Optimizer 的配置选项。以下为本人安装完成后 php.ini 里的默认配置代码(分号后面的内容为注释):
zend_extension_ts="D:\php\Zend\lib\ZendExtensionManager.dll"
;Zend Optimizer 模块在硬盘上的安装路径。
zend_extension_manager.optimizer_ts="D:\php\Zend\lib\Optimizer-2.6.2"
;优化器所在目录,默认无须修改。
zend_optimizer.optimization_level=1023
;优化程度,这里定义启动多少个优化过程,默认值是 15 ,表示同时开启 10 个优化过程中的 1-4 ,我们可以将这个值改为 1023 ,表示开启全部10个优化过程。
调用phpinfo()函数后显示:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies 则表示安装成功。
最新技术文章: