Cainiao PHP notes about half an hour in July 15: The syntax of PHP was similar to that of C language. T titun said that PHP and MySQL were added, but today we know that PHP and MySQL are not fixed combinations, in fact, it can also be connected to Oracle and other databases, but it is still about half an hour in November
The general impression is that the PHP syntax is similar to the C language. I have heard of PHP and MySQL, but today I know that PHP and MySQL are not a fixed combination. In fact, they can also be connected to Oracle and other databases. However, MySQL is common and useful.
(1) configure the Apache server:
I have heard that Apache and PHP are used together. now I know that Apache can also be used with ASP and JSP. In any case, to learn about PHP, you must first go to Apache.org to download the Apache installation package. of course, the version that can be directly installed is the one you need to compile later. As a result, the installation process is in conflict with the original IIS. because port 80 is occupied, you have to temporarily uninstall IIS. After that, everything went smoothly. enter http: // localhost/in the browser, and a large "It works!" will appear on the page !". Indicates that the installation is successful!
Haha, you can simply modify the homepage. Find the default access directory. my options are C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs. However, this directory is too long. I want to change the default access directory to E: \ php. Find httpd in C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ conf. in the conf file, find "DocumentRoot" and change the directory. However, 403 is always encountered. I am depressed and it is stuck here. Aha !!! Search for a new version of the bug? Forget it. The purpose is to PHP and change the directory back. Find a good blog during the search, http://www.chweng.idv.tw/index.php. Wait for a while before visiting.
(2) install PHP:
First of all, download the Windows Binaries ZIP package at http://www.php.net/downloads.php. Decompress the package to E: \ php. ini-recommended to php. ini and copy it to the C: \ Program Files \ Apache Software Foundation \ Apache2.2 directory to open php. ini, find extension_dir = ". /", change to extension_dir =" E: \ php ", and set; session. save_path = "\ tmp" is changed to session. save_path = "E: \ php \ session"
...... If you are sleepy, let's talk about it tomorrow.
Cainiao PHP notes about one and a half hours in December
Episode: We have reinstalled the system today. After reinstalling the system, we have reinstalled Apache again. I don't know why it is so difficult. why! After 20 minutes of fighting, I finally got it easy, but I don't know how to do it myself. I swear to learn Linux !!!
Continue, create the folder "E: \ php \ session" manually, and then modify several options. it's almost the same. Copy php5ts. dll in the PHP directory to C: \ WINDOWS \ system32. Copy php5apache2. dll to C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ modules. Finally, insert at the end of the httpd. conf file.
LoadModule php5_module modules/php5apache2. dll
AddType application/x-gttpd-php. php.
Finished. can I see if it is successful? Failed !!!!! Looking for reasons.
It seems that users notes is really useful. some people have suggested a solution below:
Philip at php dot net
05-May-2006
If you use Apache 2.2.x, the supported Ded DLLs (php4apache2. dll and php5apache2. dll) will not work for you as they are specific to the Apache 2.0.x API. there is an open bug report to address this issue but if you can't wait then go to the following URL and download an appropriate DLL for Apache 2.2.x:
* Http://apachelounge.com/
The PHP Group does not endorse this site but it appears useful, so use it :-)
I have to mention the above website. This website is a webmaster community that uses Apache Server on Windows. it is a very practical website, but considering using PHP on Linux in the future, so I will not study this website for the moment.
In short, the problem was finally solved successfully according to the steps on the website. That is to say, the PHP environment is here
Set up successfully!
However, it only took about two hours to work for 10 minutes (about one hour every day yesterday). In summary, the tutorials are different from the official website versions, besides, I downloaded the latest version and encountered an unfixed bug. In short, we should try to obtain all the resources from a website next time to avoid delays due to version inconsistency.
(3) learning PHP syntax (start learning PHP) now that the environment is ready, you can start to learn the PHP language itself. But now it's 23: 35 ...... I don't know how much I can watch today. I have to get up early tomorrow to go to the bookstore. Come on !!
Bytes. I regret that I didn't come to the official website when I started configuring the environment.
To learn PHP, download an editing tool, compile ...... In short, you can start to learn some basic syntaxes.
It seems to me that the PHP syntax and the C syntax are just too similar. the variable is only a $ difference and is a weak definition. Arithmetic operators, logical operators, expressions, control statements ...... Basically the same, the regular expression seems to be a relatively new content. after taking a look, it seems that you have to take a good time to study it.
Cainiao PHP notes about 3 hours in December
Because the syntax is basically not a waste of time, today the form processing section will soon be entered.
PHP-processed forms can be submitted by the GET or POST method. The new PHP version uses different methods to access variables: PHP automatically creates an array for the received form data. if the submission method is GET, the array is $ _ GET ["name attribute of the submitted form"], while the POST method corresponds to $ _ POST ["name attribute of the submitted form"]. You must note that you can use arrays to process check boxes and list boxes that can be selected multiple times. for example.
Form verification should be very important. after all, it is "hackers" all over the sky ". However, the concentrated methods mentioned in the tutorial are not very strict and I don't know if there will be any security topics in the future. In a word, there seems to be no difficulty in form. it may be that it hasn't involved how to associate the form data with the database.
Today's final task-file processing is also finished, but this chapter is completely back-to-function. it is basically hard to remember. it seems that you still need a lot of applications in the future to be proficient. I think the whole site program that is now popular on the Internet (I have never used it before! Really.) should I have applied a lot of these file processing functions? I don't know whether the database proportion is large for the whole site program or the file processing proportion is large.
Well, I have learned this today and will be able to start learning database programming tomorrow. It should be the essence of PHP!
Cainiao's PHP notes: the Xinhua bookstore read books for less than half an hour on September 30, July 18.
I went to Xinhua bookstore during the day, and there were few and no spam books on PHP. I really don't know why! None of the half examples of database programming in one of them are available. Are you a prodigy? As a result, I did not get any results after reading it for half an hour. another book is Dreamweaver + PHP + MySQL. although Dreamweaver is an MX version, however, I think there are still some reference values. After reading it, the book introduces some examples and code that is not implemented at the level. it is not my favorite type, but at least there are some gains, I sat there in another book for about two hours and was told by the salesperson. However, due to my IQ, I cannot understand the example-free tutorial. today I want to watch the database programming program. I have to mention that there are no other books related to PHP except the two books! The practice of this evening is relatively late, and now it is. I do not know what time I can learn.
Log on to http://www.mysql.com/to start and download the software. According to the introduction of each version, I chose a simplified package, which seems to be a more suitable installation version for Cainiao. The essential Package: This package has a filename similar to mysql-essential-5.0.23-win32.msi and contains the minimum set of files needed to install MySQL on Windows, including the Configuration Wizard. this package does not include optional components such as the embedded server and benchmark suite.
During the download wait time, I saw the following interesting content on the Mysql website: "If the world's top web websites have something in common, that is, they all need to provide fast (search, Operation) results to millions of users at the same time. Another thing they have in common is that they all use MySQL. The MySQL database enables many similar websites, such as Craigslist, Google, Yahoo, Wikipedia, Feedburner, and Digg, to freely face their growing users and transactions ".
If there's one thing the top Web 2.0 sites in the world have in common, it's that they need to deliver fast results to millions of simultaneous users. the other thing they have in common is MySQL. the MySQL database server enables Web sites like Craigslist, Google, Yahoo, Wikipedia, Feedburner, Digg and thousands of others to scale out to meet ever-increasing volumes of users and transactions.
The installation process of MySQL is relatively simple and smooth. Then, the configuration is configured. Open the previous php. ini, find MySQL in it, and add the following attributes:
Mysql. default_port = 3306
Mysql. default_host = localhost
Mysql. default_user = root
Mysql. default_password = your password
Remove extension = php_mysql.dll. This completes the MySQL configuration. Then I am sleepy ...... Then ......
Cainiao's PHP notes were taken for another day in July 19 due to something
Cainiao PHP notes: reading books for 3 hours on April 9, July 20
Today, I finally finished my database programming and didn't look at the stored procedures and transaction processing. Basically, I didn't encounter much difficulties. The rest is session control.
Today, I finally started to practice database programming, but it was very difficult. First of all, I was unable to connect to the database, so I was depressed! The following statement always appears: "Fatal error: Call to undefined function mysql_connect () in C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs \ first. php on line 2 "for half an hour, the problem still persists, and I am depressed !!!! After being depressed for N minutes (actually going online), I deleted all PHP-related things, including Apache, MySQL, and PHP. Then I applied for a free space with MySQL, but unfortunately there was an advertisement. However, the connection is successful after testing.
The code for the first page is as follows, which is memorable.
The execution result is as follows:
Http://php6.cafe150.com/1.php
I forgot to add a line feed. it seems that I am not used to the PHP output mode.
Exercise connecting to database
$ Link = mysql_connect ('localhost', '123', '123 ');
If (! $ Link) die ('Fuck connection and TM failed: '. mysql_error ());
Echo 'bird's, look at the database and system: '. mysql_get_host_info ($ link );
Echo '?????? The advertisement above is not mine. it is from a space provider! ';
Mysql_close ($ link );
?>
The above is the content of Cainiao's PHP notes (1, 2). For more information, see PHP Chinese website (www.php1.cn )!