Problems
Call the Xhprof_enable method multiple times, which is the last configuration that takes effect?When you call the Xhprof_enable method more than once in a request, only the settings that are made when the first call takes effect. In the
Session configuration instructions in php.ini
The following are the necessary configuration steps to enable the session to run
Manually Configuring the PHP runtime Environment, the most easily forgotten is the server-side session file storage
CentOS under:
After using SSH login CentOS, execute the following command:1. ImplementationYum Install php-mbstring
2. Modify PHP.iniVi/etc/php.ini #将下面内容前面的分号去掉, if you do not have this line, join the line directly extension=mbstring.so;
$TPL =new Smarty ()//New Smarty object, I'm using the Smarty-3.1.6 version
1. Set Smarty template path $tpl->settemplatedir (); By default, templates
2. Set the Smarty template compilation Path $tpl->setcompiledir (); By default, Templates_c
3.
With Pear::benchmark, you already know how to test your code, know how to determine if your code is fast or slow, and which part is slower. So the next thing I want to say is how to eliminate or optimize that part of the slow code. My personal main
To write an ActiveX Dll first:To create a new VB6 project, the ActiveX DLL names the project P_test, the class name is C_test, and the file contents of the class are as follows: Option ExplicitPrivate Myscriptingcontext as ScriptingContextPrivate
5. Other Miscellaneous5.1 Generating Images PHP can manipulate image processing. If you have installed the GD library, you can even use PHP to generate images.?Header ("Content-type:image/gif");$string=implode ($ARGV, "");$im = Imagecreatefromgif
The Advantages of PHP:
1. Cross-platform, superior performance, with Linux/unix combined with Windows strong performance of 45%, and with many free platform combination is very economical, such as lamp (linux/apache/mysql/php) or Famp
1. Concurrency issues
Concurrency we all know what is the case, here is a concurrent multiple requests to preempt the same resource, directly on the example bar
Request: Index.php?mod=a&action=b&taskid=6
Processing:
$key = "A_b::". $uid. ' _ '. $
User authorization is also a part of the advanced interface, just separate it out, so that the entire micro-letter framework is clear, but we use it first to set the OA2 URL in the micro-letter background, where the URL and tutorial a different. It
1, Installation XCache expansion
TAR-XVF xcache-3.2.0.tar.gzCD xcache-3.2.0./configure--with-php-config=/usr/local/php/bin/php-config--enable-xcacheMake && make install
Will generate similar information like the following
[Root@master xcache-3.2.0
This problem has been encountered by the cliff before, too long did not write do not remember (seems to be the CI frame directly related functions), and then met again, rolled to check again, here is not the case is PDO, but with the outdated
The code is as follows:Copy code Class listdir {Var $ depth;Var $ dirname;Var $ list;Var $ tostring;Function listdir ($ dir ){$ This-> dirname = $ dir;$ This-> depth = 0;$ This-> tostring = "";}// Save the result to a multi-dimensional
How to disable PHP promptsSearch for php. ini: The code is as follows:Copy code Error_reporting = E_ALL Changed: The code is as follows:Copy code Error_reporting = E_ALL &~ E_NOTICE There is another way to do this:Add each file headerError_
The Yaf PDO encapsulation class of php framework is integrated with ORM. yaf itself does not contain orm data encapsulation. We can implement our own encapsulation on pdo.I. First, we use the php Singleton mode to create a base class. Library \ Base.
When using nginx for webserver, pay special attention to the client_max_body_size parameter when uploading large files. Otherwise, the access will be interrupted in nginx requests and cannot be recorded in php.First, modify the php. Ini file:
PHP regular expressions1. Write a function to verify that the email format is correct.Function checkemail ($ email ){Echo preg_match ('/^ [w] + @ [w] + [.] ([w] +) $/', $ email )? 'Email format is correct ': 'Incorrect email format '; }Pair2.
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