


Does phpstudy have a mac version? How to use phpstudy under Mac system
Background
I am learning PHP recently, because I don’t want to I spent too much time setting up the environment. In addition, I have used phpstudy on Linux and Windows before. This time I also want to use phpstudy on the mac system. However, I checked online and found that there is no relevant phpstudy installation package on the mac. What should I do? I just used vagrant before, and virtualbox can be used with the Linux version of phpstudy. With the idea in mind, let’s take a look at what we need to prepare to complete our above idea
Prerequisites
1. mac os System
2. vagrant
3. virtualbox
4. git
5. phpstudy
6. Offline version box
Start processing
First install vagrant and virtualbox
Download vagrant mac Version installation package, install it directly by dragging it into Application. Install virtualbox in the same way.
After installation, since the network environment is not very good, we will not use vagrant directly here. Use your own box store. The Centos 7 box downloaded offline is first added to vagrant. The command is as follows
Add the offline box to vagrant
vagrant box add centos/7 /Users/ylf/Desktop/centos-7.0-x86_64.box
After adding, you can use the following command to check whether it is correct
vagrant box list
Create the Vagrantfile configuration file and run the virtual machine
Create a new directory and create a Vagrantfile file in the directory with the following content
# -*- mode: ruby -*- # vi: set ft=ruby : # All Vagrant configuration is done below. The "2" in Vagrant.configure # configures the configuration version (we support older styles for # backwards compatibility). Please don't change it unless you know what # you're doing. Vagrant.configure("2") do |config| # The most common configuration options are documented and commented below. # For a complete reference, please see the online documentation at # https://docs.vagrantup.com. # Every Vagrant development environment requires a box. You can search for # boxes at https://vagrantcloud.com/search. config.vm.box = "centos/7" # config.vm.box_version = "1801.02" # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs # `vagrant box outdated`. This is not recommended. # config.vm.box_check_update = false # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine. In the example below, # accessing "localhost:8080" will access port 80 on the guest machine. # NOTE: This will enable public access to the opened port # config.vm.network "forwarded_port", guest: 80, host: 8080 # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine and only allow access # via 127.0.0.1 to disable public access # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" config.ssh.username='root' config.ssh.password='vagrant' config.ssh.insert_key='true' # Create a private network, which allows host-only access to the machine # using a specific IP. # config.vm.network "private_network", ip: "192.168.33.10" # Create a public network, which generally matched to bridged network. # Bridged networks make the machine appear as another physical device on # your network. # config.vm.network "public_network" config.vm.network "public_network" , ip: "192.168.3.233" ,bridge: "en1: Wi-Fi (AirPort)" # Share an additional folder to the guest VM. The first argument is # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. # config.vm.synced_folder "../data", "/vagrant_data" # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: # # config.vm.provider "virtualbox" do |vb| # # Display the VirtualBox GUI when booting the machine # vb.gui = true # # # Customize the amount of memory on the VM: # vb.memory = "1024" # end # # View the documentation for the provider you are using for more # information on available options. # Enable provisioning with a shell script. Additional provisioners such as # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the # documentation for more information about their specific syntax and use. # config.vm.provision "shell", inline: <<-SHELL # apt-get update # apt-get install -y apache2 # SHELL end
Then open the terminal in the corresponding directory and enter the following command in the terminal
vagrant up && vagrant ssh
Wait a moment, the virtual machine should be ready After creation, the system will ask you to enter a password. The default password for the virtual machine created by vagrant is vagrant. Enter vagrant in the terminal. When entering the password in these terminals, the entered characters will not be displayed. After inputting, just hit Enter. At this point the Linux environment has been configured.
Briefly explain what the above configuration items mean
Set the box used to centos/7
config.vm.box = "centos/7"
Set the default user to root, otherwise the default user is vagrant
config.ssh.username='root' config.ssh.password='vagrant' config.ssh.insert_key='true'
Because it is a machine for learning, the ip is set to a static ip so that the virtual machine and your computer agree on the LAN and can communicate directly.
Tips: The ip address here is set according to the actual ip of your computer. Ifconfig finds the specific ip, the ip here is set to be similar to it. Bridge is a bridge network card. Here I am The wireless network card used, if it is a wired connection, please set it according to the value found in ifconfig
config.vm.network "public_network" , ip: "192.168.3.233" ,bridge: "en1: Wi-Fi (AirPort)"
The virtual machine should have been set up here
Install phpstudy
Put the downloaded phpstudy-all.bin into the same directory as Vagrantfile, and then copy the phpstudy-all.bin installation package to the ~ directory
cp /vagrant/phpstudy-all.bin ~/
Then perform authorization, install
chmod +x ~/phpstudy-all.bin ~/phpstudy-all.bin
and wait for the installation to be completed. Depending on the actual situation, the installation time of each machine is different, ranging from a few minutes to dozens of minutes, depending on the network speed. It also has something to do with the disk. At this time, phpstudy has been installed. After the installation, test whether phpstudy can be started easily and normally.
phpstudy restart
The following error may occur at this time. This reason is because psmisc is not installed, just install it
line 82: killall: command not found
Install psmisc
yum install psmisc
At this point phpstudy has been installed and configured, but if we use it for development, we still need to set up some other things. We need to set up mysql for remote access
mysql remote access
Still run the following command in that virtual machine to log in to mysql
/phpstudy/mysql/bin/mysql -u root -proot
Log in to mysql and adjust the current database
use mysql;
Give the root user remote access rights
grant all privileges on *.* to 'root'@'%' identified by 'root'; flush privileges;
Turn off the firewall
systemctl stop firewalld
Disable the firewall from booting
systemctl disabled firewalld
Here mysql remote connection has been opened, on mac The installation of phpstudy is almost over here. Due to the space, we will talk about how to use phpstorm to cooperate with phpstudy for remote debugging, remote deployment, and automatic upload
Recommended tutorial:phpStudy Quick Getting Started Video Tutorial
The above is the detailed content of Does phpstudy have a mac version? How to use phpstudy under Mac system. 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

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.
