How to install php7 on macbook pro
How to install php7 on macbook pro: 1. Install Homebrew; 2. Install PHP7 through brew and execute commands such as "$ brew install php70"; 3. Configure Apache; 4. Restart Apache.
The operating environment of this article: macOS10.15 system, php7 version, macbook pro 2020 computer
How to install php7 on macbook pro?
Mac installation PHP7:
After a long wait, after our PHP5.6 was released, our latest PHP7 was finally released (waiting Wait, where is our 6?), according to the official statement, the current PHP7 is twice as fast as PHP5.6, so if we want to try it out, how can we experience it?
In fact, we have several ways to install it.
First, we can go to the official website and download the source code to compile it, so I won’t go into details about this.
Second, we can use our third-party package to install, such as homebrew. This article will describe how to install using this method.
Installation method
First we need to install Homebrew
Install through brew:
$ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/homebrew-php // 创建目录 sudo mkdir /usr/local/var sudo chmod 777 /usr/local/var //修改成你自己的用户名和组 sudo chown -R <username>:<group> /usr/local/sbin sudo mkdir /usr/local/sbin/ //安装PHP7 $ brew install php70 //删掉以前安装的PHP5.6 //你可以根据自己的情况来修改 $ brew unlink php56 $ brew link php70 //大功告成 $ php -v PHP 7.0.0 (cli) (built: Dec 2 2015 13:06:23) ( NTS ) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
Configure Apache
$ sudo vim /etc/apache2/httpd.conf
Find this line and comment it out (about line 168)
#Comment out the PHP5 module #LoadModule php5_module libexec/apache2/libphp5.so #Enable PHP 7 module LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>
Restart Apache
sudo apachectl restart
Go to your Apache’s default directory/Library/WebServer/Documents and add an info.php document.
<?php phpinfo(); ?>
Finally go to your http://localhost/info.php to see the test below. If you see relevant information, it means it has been installed.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install php7 on macbook pro. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Have you ever encountered the "Printer encryption credentials have expired" error message on your Apple Mac computer when trying to print a document? Don't worry! In this tutorial, I will share how to fix expired printer encryption credentials on Apple computers. Let’s get started without further ado. Have you ever encountered the "Printer encryption credentials have expired" error message on your Mac when trying to print a document? Don't worry! In this tutorial, I will share how to fix expired printer encryption credentials on Mac. Let’s get started without further ado. What does it mean if printer encryption credentials expired on Mac? How to Fix Expired Printer Encryption Credentials on Mac Additional Tips and Precautions What Does Expired Printer Encryption Credentials on Mac Mean? Printer encryption credentials on Mac

Want to stop your Apple Macbook from going to sleep? These are all your options. Apple designed macOS for maximum energy efficiency. Therefore, by default, Apple Mac computers will try to save power as much as possible to extend battery life. Therefore, when you stop using your Mac temporarily, it automatically goes to sleep to save energy. You probably don't want your Mac to go to sleep when you're working on an important task. This guide will show you how to prevent your Mac from going to sleep and keep it awake. How to turn off sleep mode on your Mac macOS lets you control how and when your Mac goes to sleep. However, with the arrival of system settings in macOS Ventura, you may be saving energy

Bluetooth accessories such as mice and keyboards are very convenient for your Apple Mac computer. However, these devices have a limited battery life, so checking their battery life regularly ensures you're not caught off guard by sudden disconnections. Who wouldn’t want to check the battery level of a Bluetooth accessory with just a few clicks? Fortunately, your Mac offers several easy ways to check the battery level of Bluetooth devices connected to your Apple Mac computer. Let’s explore these simple options. 1. Check from the Menu Bar on Mac In a Mac, the menu bar is one of the easiest areas to view. Just swipe your cursor to display the menu bar. And, you can make the menu bar always visible in full-screen mode. If you don't see the Bluetooth icon in the menu bar, you need to manually

Do you find that when you don't use your Mac for more than a minute, you constantly need to wake it up? Or do you have the opposite problem, where you leave your Mac alone for a few hours, only to find that when you return it's still awake with the screen on? On your Mac, you can control exactly how long you spend inactive before your display and other components go to sleep. Here's how to adjust your Mac's sleep time. How to set sleep time on Mac In Mac system settings, you can choose how long the display waits before going to sleep. You can choose anywhere from one minute to three hours, or you can choose to have the display never sleep unless you manually put it to sleep. The steps are slightly different depending on which version of macOS you are running.

When you store photos on your Mac, you sometimes include some private photos. To ensure their privacy, you may consider locking them. This prevents others from viewing the photos without permission. This article will explain how to lock photos on Mac to ensure that only you can access them when you need them. How to Lock Photos on Mac [2 Methods] You can lock photos on Mac in two ways – using the Photos app or the Disk Utility app. Method 1: Use the Photos app You can use the Photos app to lock your photos if they are stored in the app. If your photos are stored elsewhere, you'll need to lock them by moving them to the Photos app. Step 1: Add the picture

If you want to organize the files and folders on your Apple Mac computer, you may consider moving some content. By moving items, you can create a more organized file structure to work more efficiently or find what you need faster. We'll show you how to move files and folders on macOS using drag and drop, shortcuts or right-click menus, Terminal, and more so you can use the method that makes more sense or that you're most comfortable with. Method 1: Use Drag and Drop on Mac The easiest way to move files and folders on Apple Mac computers is through drag and drop. Whether you're rearranging icons, widgets, and shortcuts on your desktop, or moving items to other locations on macOS, this method is very convenient and easy to use. 1.Open in two

If you have ever used a Linux system, you may be familiar with the Apt-get command. It is a command used to install applications or software packages on Linux systems. Although macOS and Linux have some similarities, only a very small number of Linux packages can be installed on macOS. Especially older versions of macOS are more likely to be unable to run Linux applications. Can't find apt-get command? When users try to install Linux applications on macOS, they may receive an "Apt-get command not found" message. Actually, there is nothing wrong with the Apt-get command itself, but it doesn't work on macOS. This is because macOS doesn't have a built-in

If you recently switched to macOS, you might want to know how to right-click on Mac. On macOS, right-clicking works a little differently than on Windows. On a Mac, you can use your trackpad or mouse to right-click. If you're using a trackpad, you can right-click by tapping two fingers on the right side of the trackpad simultaneously. If you're using a mouse, there's usually a right-click button that you can click directly on to right-click. Right-clicking opens a context menu with options for the selection, as well as accessing shortcuts and other submenus. This makes operating on Mac more convenient and efficient. In this guide, I will show you how to use different devices on your Mac such as the default touch
