Experience: PHP installation and setup tips _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Experience: PHP installation and setup tips. When you just learned about PHP, you may be troubled by PHP installation and setup problems. here we will introduce some tips for installing and setting PHP. I will share them with you here. 1: when setting doc_root, you may be troubled by PHP installation and setup problems. here we will introduce some tips for installing and setting PHP. I will share them with you here.

1: doc_root settings

Doc_root in php3.ini is like documentroot in the web. If include "/xxx"; automatically changes the first/to doc_root.

For example, if doc_root is set to c: mp in php3.ini, your aaa. php should be in the c: mpdir1 directory when include "/dir1/aaa. php" is set.

2: php4.00 session settings

In php4.00, it is always difficult to set the tmp Directory of the session. In fact, you only need to set the tmp directory to the root directory of the current php disk.

For example, if your php4 is on an edisk, you only need to create a tmp directory in the root directory of the edisk. However, the latest version does not seem to have this problem.

3: How can I make mistakes when uploading files?

Sometimes it is often the most basic thing to forget. for example, in php. ini, have you set uploadtemp_dir.

4: How does php4.0.0 support sybase in solaris?

First, you must install the sybase client software. Otherwise, the system will prompt that the system cannot be found during php compilation. H file. add the -- with-sybase parameter when you run the configure script before compiling php. use the make command to compile php, make install to install it, and modify httpd. conf restarts apache daemon. that's all.

5: Why cannot I use crypt ()?

Crypt () is in UNIX/Linux and cannot be used directly in MS unless there is a php_crypt.dll file.

6: Is there an application variable in ASP in PHP?

No, at least not in the current version! However, you can use other methods.
(1) in Linux/Unix, you can use the shared memory method (phpchina.com has an article)
(2) it can be implemented through database or file
(3) Other methods...

7: questions about the Session

Q: If I share an IP address through the proxy server, will the session on the server conflict?

A: Actually, you don't have to worry about this. The session is built on the cookie, but the information is stored on the server and on the client. it has nothing to do with the ip address.

8: Cookie concerns

Q: I tested the COOKIE on the local host to save some values in the message book, so that I do not need to fill in the next message, but I found this situation: that is, before my entire webpage is closed, everything works normally. However, if the webpage is closed and re-opened, the reserved COOKIE value cannot be read, no matter how many times I set the COOKIE's validity period, it is useless. Why does this happen ??? If the proxy server shares a single IP address, will the session on the server conflict?

A: The default validity period of a cookie is the connection status. that is to say, when you connect a browser to this site, the cookie is valid. as long as one window is open, the cookie is still valid, however, when you close the last window, the link between you and the site becomes invalid. of course, your cookie becomes invalid. you can use setcookie ('$ cookie_name', '$ cookie_vaue', time () + $ sec + 8*3600); to set the validity period. The above are tips for installing and setting PHP in my work. have you learned?


Bytes. 1: doc_root settings...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.