Home Operation and Maintenance phpstudy Does phpstudy have a mac version? How to use phpstudy under Mac system

Does phpstudy have a mac version? How to use phpstudy under Mac system

Jun 10, 2019 pm 01:37 PM
mac php phpstudy

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
Copy after login

After adding, you can use the following command to check whether it is correct

vagrant box list
Copy after login

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
Copy after login

Then open the terminal in the corresponding directory and enter the following command in the terminal

vagrant up && vagrant ssh
Copy after login

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"
Copy after login

Set the default user to root, otherwise the default user is vagrant

config.ssh.username=&#39;root&#39;
config.ssh.password=&#39;vagrant&#39;
config.ssh.insert_key=&#39;true&#39;
Copy after login

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)"
Copy after login

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 ~/
Copy after login

Then perform authorization, install

chmod +x ~/phpstudy-all.bin
~/phpstudy-all.bin
Copy after login

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
Copy after login

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
Copy after login

Install psmisc

yum install psmisc
Copy after login

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
Copy after login

Log in to mysql and adjust the current database

use mysql;
Copy after login

Give the root user remote access rights

grant all privileges on *.* to &#39;root&#39;@&#39;%&#39; identified by &#39;root&#39;;
flush privileges;
Copy after login

Turn off the firewall

systemctl stop firewalld
Copy after login

Disable the firewall from booting

systemctl disabled firewalld
Copy after login

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

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

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

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

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

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,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

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

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

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

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

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 PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

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: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

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.

See all articles