How to solve "Nosuchfileordirectory" error when connecting PHP to MySQL in Mac
"No such file or directory" error reported when connecting PHP to MySQL in Mac
First, let's give a brief introduction.
[NOTE 1] installation path of MYSQL in MAC:/
(1) Open Apache (because the Mac comes with Apache, so it only needs to be turned on)--In the terminal input, prompted to enter the password.sudo apachectl-k start--Verify: Enter 127.0.0.1 or localhost in the browser to display "It works! "That
Unified page EncodingMySQL database encoding, HTML page encoding, PHP or HTML files themselves are encoded to be identical.1. MySQL Database code:When you create a database, specify the encoding (such as GBK_CHINESE_CI), create a data table, create
The default session validity period in PHP is 1440 seconds (24 minutes). What should we do if we want to keep the session from expired? Next we will introduce the best way to do this without modifying the program, if you modify the program, the test
1 To http://xdebug.org/download.php to download xdebug. Find your php version. You can also copy phpinfo's information on the page http://xdebug.org/wizard.php and click the bottom analysis. It tells you which version to download and how to
When developing an Internet service, you must always keep in mind the concept of security and be in the Code of development. The PHP scripting language does not care about security issues, especially for most inexperienced developers. Whenever you
Apache + mysql + php environment configuration, apachemysqlPreparations before configuration
1. Set the environment variable first (for win7)
Win10
2. Configure apache
I use EditPlus to open httpd. conf
LoadModule php5_module
First look at the PHP configuration file, which is under this path[Email protected] ~]# Vim/usr/local/php/etc/php.iniIf you don't know where he is, we have a way to check it out.[Email protected] ~]#/usr/local/php/bin/php-i |headPhpinfo ()PHP
1. Open PHP ModePrinciple:Header ("Content-encoding:gzip"); Echo gzencode (' Songjiankang ');Example 1:function Ob_gzip ($content)//$content is the content of the page to be compressed, or the cookie raw material { if (! headers_sent () &&
Commonly used vim keys:Select when forwardY copyP Sticky StickerX DeleteI editESC Exit Edit: Wq Save Exit: q! Do not save exit/ Find stringThe command line to usesudo executes commands with Administrator privilegesLS Displays
After learning PHP for so long, I found that WAMP has updated several versions yesterday, And my version is old. Of course, the version is not important.
I reviewed the WAMP configuration method. I manually and automatically configured it in the
Open php. ini, first find;;;;;;;;;;;;;;;;; File Uploads;;;;;;;;;;;;;;;;;Region, which has the following parameters that affect file upload:File_uploads = on; whether to allow file upload over HTTP. ON is enabled by default.Upload_tmp_dir; upload the
1. APC cache OverviewAPC, full name: Alternative PHP Cache, officially translated as "Optional PHP Cache ". It provides us with a framework for caching and optimizing PHP intermediate code. APC Cache consists of system cache and user data
So that the PHP session will never expire, you may not have encountered such a depressing problem, but I have encountered, very depressed.
We have developed a system that can only be used by our Customer Service staff-limited customer service staff.
PHP gives developers a great deal of flexibility, but this also poses a potential risk to security issues, the recent need to summarize the past problems, here to lend a translation of an article at the same time with their own development of some
For ($ I = 10; $ I> 0; $ I --)
{Echo $ I;
Flush ();
Sleep (1 );}
?>
According to the php Manual
This function sends all the output of the program so far to the user's browser.
The above code should output $ I every second. But not necessarily in
This article describes in detail the introduction, parameter configuration, installation steps, and usage of the PHPAPC module. some of the content is translated from PHPManual and may be incomplete. I hope you can correct me.
1. APC cache
This article describes how to install the php plug-in and use the Xdebug configuration in Eclipse. For more information, please refer to the android development team and become addicted to android automated testing. all of them have been using
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.