The acquiescence of the virtual host php.ini file

Source: Internet
Author: User
Tags mysql query cpanel bluehost cpanel
Default php.ini file for virtual hosts
Bluehost cpanel can generate a default php.ini configuration file, if you need to make some special settings, you can download the file after the local edit the file upload to the appropriate directory, the edits are effective immediately.
Methods for generating php.ini:
Login cpanel–>software/services–>php config–>
Select: Install Default php.ini, which will generate a standard configuration file named: Php.ini.default in the main virtual directory. Because the file suffix has. Default so don't worry about overwriting existing php.ini files.

Some friends when using Bluehost for program upgrade, will appear the following prompt:

Fatal error:allowed memory size of 33554432 bytes exhausted (tried to allocate 2361357 bytes) in/home/xxx/public_html/xx x/xxx/xxx.php on line 1324

Display memory limit is too small, there is no way, can only upload ID attachment to open SSH.

In fact, this can be modified, the way to solve this is:

1. Select PHP Config in the cpanel panel, select PHP5 (Single php.ini), click Save

2, enter the file Manager, enter public_html, find php.ini, modify memory_limit = 32M = Memory_limit = 128M

After the setup is complete, you are ready.

Sometimes found that the Bluehost virtual host has CPU timeout limit problem, check the third party statistics PV average value is less than 10,000, there is no reason for this problem, my other account in the same traffic without any problems, view CPU exceeded The log message indicates that the MySQL query timed out.

The possible causes of the Bluehost virtual host CPU timeout limit are as follows:
1.MySQL database file Fragmentation is too much, the workaround is to defragment the database.
2. Too many search engine spiders submit database query requests, bad collection, malicious access, and so on, to solve the method of blocking!
3. Website source code, script inefficient or poorly configured, my account for a good run for a long time, there is no problem, to exclude this possibility.

Bluehost Virtual Host CPU timeout limit, not a serious problem, after 5 or 6 minutes will automatically return to normal, do not worry.

The first step is to find out why:
It is best if you can directly find the problem that caused the CPU timeout limit, because the Bluehost virtual host can run multiple sites simultaneously in one account, with its complexity.
If it is not confirmed that a problem is triggered, can be delineated several factors, one by one.

The second step is to solve the problem:
Above and mentioned, the solution is quite simple, is nothing more than shielding poor access source, modify the source and collation MySQL database (a single 500M below the MySQL database to produce file fragments and thus the possibility of a time-out is very small, basically can not be considered. )。

Obviously the difficulty is not how to solve the problem, to find the cause of CPU timeouts is the key.

Open the "/tmp/cpu_exceeded_logs" directory for the Bluehost virtual host, which holds the log files when the CPU exceeded occurs. Here we can find the information we need,
Includes: In the minute of the timeout, what processes are accessing specific access times to which sites within the account, but this information does not seem to help us find special problems, such as the IP used by a malicious visitor. Luckily Bluehost prepared everything for us, we can go check the access log (* We usually use the third-party statistics, usually cannot see the spider's access record, but in the Bluehost virtual host's log can be seen)
  • 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.