Install php7.2+
Steps
- Install HomeBrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
- Install Php with Brew
brew install [email protected]
// Error: [email protected] has been disabled because it is deprecated upstream!
// 提示官方已不再维护
- Use a third-party repository
// 将第三方仓库加入brew
brew tap shivammathur/php
// 安装PHP
brew install shivammathur/php/[email protected]
- Prompt to write environment variables
- Go to the folder
~/
, modify.bash_profile
the file
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
- Go to the folder
~/
, modify. zshrc
the file
source ~/.bash_profile
- link php version
brew link --overwrite [email protected]
- Restart the terminal or execute
brew services restart php
- check php version
php -V
- other configuration
Modify the file /usr/local/etc/php/7.2/php-fpm.conf, remove the semicolon in front of the 17th and 24th lines
other instructions
- Make sure that the ssh -T [email protected] link github command is normal
install composer
- Download composer (eg. 2.4.4): https://getcomposer.org/download/
- Move
composer.phar
the file to/usr/local/bin
the next: open the terminal to execute the commandmv composer.phar /usr/local/bin/composer
- Give composer execution permission:
chmod +x /usr/local/bin/composer
- test
composer
Install multiple versions of php --2023.01.14 update
Steps
- View warehouse
brew search php
- Install php5.6
brew install shivammathur/php/[email protected]
- Add PHP environment variables
# 终端
vim ~/.bash_profile
# 新增
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"
# 终端 刷新 ~/.bash_profile
source ~/.bash_profile
- Install the PHP version switching tool brew-php-swither
brew install brew-php-switcher
- Switch and use different versions of php
# 切换版本
brew-php-switcher 5.6
brew-php-switcher 7.2
php -v
# 其他命令
brew services start [email protected] # 启动 php5.6
brew services stop [email protected] #关闭 php5.6
Digression
In this first year of fast-growing technology, programming is like a ticket to a world of infinite possibilities for many people. In the star lineup of programming languages, Python is like the leading superstar. With its concise and easy-to-understand syntax and powerful functions, it stands out and becomes one of the most popular programming languages in the world.
The rapid rise of Python is extremely beneficial to the entire industry , but " 人红是非多
" has caused it to add a lot of criticism, but it still cannot stop its hot development momentum.
Will Python remain relevant and intact for the rest of the next decade? Today, we're going to analyze the facts and dispel some misconceptions.
If you are interested in Python and want to get a higher salary by learning Python, then the following set of Python learning materials must be useful to you!
Materials include: Python installation package + activation code, Python web development, Python crawler, Python data analysis, artificial intelligence, machine learning and other learning tutorials. Even beginners with 0 basics can understand and understand. Follow the tutorial and take you to learn Python systematically from zero basics!
1. Learning routes in all directions of Python
The route of all directions in Python is to organize the commonly used technical points of Python to form a summary of knowledge points in various fields. Its usefulness lies in that you can find corresponding learning resources according to the above knowledge points to ensure that you learn more comprehensively.
2. Python learning software
If a worker wants to do a good job, he must first sharpen his tools. The commonly used development software for learning Python is here!
3. Python introductory learning video
There are also many learning videos suitable for getting started with 0 basics. With these videos, you can easily get started with Python~
4. Python exercises
After each video lesson, there are corresponding practice questions, you can test the learning results haha!
Five, Python actual combat case
Optical theory is useless. You have to learn to type codes along with it, and then you can apply what you have learned in practice. At this time, you can learn from some practical cases. This information is also included~
6. Python interview materials
After we have learned Python, we can go out and find a job with the skills! The following interview questions are all from first-line Internet companies such as Alibaba, Tencent, and Byte, and some Alibaba bosses have given authoritative answers. After reading this set of interview materials, I believe everyone can find a satisfactory job.
7. Information collection
The full set of learning materials for the above-mentioned full version of Python has been uploaded to the CSDN official website. Those who need it can scan the QR code of the CSDN official certification below on WeChat to receive it for free.