In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "mac how to modify php.ini". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
Mac modify php.ini method: 1, execute "sudo cp/private/etc/php.ini default/private/etc/php.ini" command;2, directly modify php.ini configuration file.
Operating environment: macOS 10.15 system, PHP 7.1 version, MacBook Air 2019 computer
PHP uses to modify php.ini configuration file (Mac)
I. Configure php.ini in Mac's own PHP environment
Mac OS X does not have a default php.ini file, but there is a corresponding template file php.ini.default, located in/private/etc/php.ini.default or/etc/php.ini/default, you can copy a copy to modify.
Copy command:
sudo cp /private/etc/php.ini.default /private/etc/php.ini
After successful replication
cd /private/etc/sudo vi php.ini II. Modify php.ini configuration file in XAMPP For Mac
Modify the php.ini configuration file in the installation directory/Applications/XAMPP/xamppfiles/etc/php.ini
file_uploads=on/off Whether to allow uploading files via http max_execution_time=30 Maximum script execution time allowed, error will be reported if this time exceeds memory_limit=50M Set the maximum amount of memory that can be allocated by scripts to prevent uncontrolled scripts from occupying too much memory. This command only takes effect when the-enable-memory-limit flag is set during compilation upload_max_filesize=20M Maximum file size allowed to upload. This directive must be less than post_max_sizeupload_tmp_dir Upload file temporary storage directory post_max_size=30M Allow post mode to accept the maximum size
The $_FILES array contains the following:
$_FILES <$'myFile']<$'name'] The original name of the last file on the client side $_FILES <$'myFile']<$'type' MIME type of the file, which requires the browser to provide support for this information, for example,"image/gif"$_FILES <$'myFile']<$'size'] The size of the uploaded file, in bytes $_FILES <$'myFile']<$'tmp_name'] Temporary file name stored on the server after the file is uploaded, generally the system default. This can be specified in upload_tmp_dir of php.ini, but the putenv() function is used to set $_FILES <$'myFile ']<$'error'] and the file uploads the associated status code
$_FILES ['myFile ']['error'] and the status code associated with uploading the file. "'error '] was added in PHP 4.2.0. Here are its descriptions: (They became constant after PHP 3.0)
UPLOAD_ERR_OK value: 0 No error occurred, file upload succeeded UPLOAD_ERR_INI_SIZE value: 1 The uploaded file exceeds the value of upload_max_filesize option in php.ini UPLOAD_ERR_FORM_SIZE value: 2 The size of the uploaded file exceeds the value specified by MAX_FILE_SIZE option in HTML formUPLOAD_ERR_PARTIAL value: 3 Only part of the file is uploaded UPLOAD_ERR_NO_FILE value: 4 No file is uploaded value: 5 The size of the uploaded file is 0
After the file is uploaded, it is stored in the temporary directory by default. You must delete it from the temporary directory or move it to another place. If not, it will be deleted.
That is, regardless of whether the upload is successful or not, the files in the temporary directory will definitely be deleted after the script is executed.
Attachment: How to modify PHP upload file size limit 1. General file upload, unless the file is very small. Like a 5 megabyte file, it probably takes more than a minute to upload.
In PHP, however, the default maximum page execution time is 30 seconds. This means that after 30 seconds, the script stops executing.
This results in a situation where the page cannot be opened. We can modify max_execution_time.
Find it in php.ini
max_execution_time
The default is 30 seconds. changed to
max_execution_time = 0
0 means no restrictions
2. Modify post_max_size to set the maximum size allowed for POST data. This setting also affects file uploads.
php defaults to post_max_size of 2M. If POST data size is larger than post_max_size $_POST and $_FILES superglobals, it will be empty.
Find post_max_size . changed to
post_max_size = 150M3. A lot of people change the second step. However, the maximum file upload is still 8M.
Why not? We also need to change the upload_max_filesize parameter to indicate the maximum file size to upload.
Find upload_max_filesize, default is 8M instead
upload_max_filesize = 100M
Post_max_size is greater than upload_max_filesize.
"mac how to modify php.ini" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.