search
HomeBackend DevelopmentPHP TutorialOverview of the integration process of macos+apache+php+phpmyadmin_PHP tutorial

Start Apache

There are two methods:

In this way, enter "http://localhost" in the browser, you can see a page with the content "It works!", which is located under "/Library (resource library)/WebServer/Documents/", this This is the default root directory of Apache.

Run PHP

Install MySQL

Mac OS X does not have built-in MySQL, so you need to install it manually. Currently, the most stable version of MySQL is 5.5. MySQL provides installation instructions for Mac OS X.

Note: Upgrading of Mac OS Changes have occurred, just run "Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ". /usr/local/mysql/data sudo chown -R mysql /usr/local/mysql/dataIn addition, when using PHP to connect to MySQL, the error "Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'" may be reported, or using localhost cannot connect to MySQL and requires 127.0.0.1, because the connection PHP looked for

by default, but the MAC version of MYSQL changed the file location and placed it under /tmp. The solution is to modify php.ini as follows:

/var/mysql/mysql.sock

Use phpMyAdmin
<code>mysql.default_socket = /tmp/mysql.sock<br /></code>
phpcms

. The steps are as follows:

Solution
<code><br /><br /><span><span <strong>关于错误处理:</strong></span><br /></span></code>

Copy config.sample.inc.php to config.inc.php
<code></code>

This error occurs, indicating that there is no connection to the database. Modify the config.inc.php file,

<code></code>
Set $cfg['Servers'][$i]['host'] = 'localhost';
<code></code>
Change to $cfg['Servers'][$i]['host'] = '127.0.0.1';
<code></code>
<code></code>
-------------------------------------------------- ---
<code></code>

<code></code>or

modify php.ini: mysql.default_socket = /tmp/mysql.sock

<code></code>

#1045 Unable to log in to MySQL server . Access denied for user 'root'@'localhost' (using password: YES)

Cause of the problem: This may be due to the failure to set the mysql password previously, which resulted in us being unable to log in to the server using the set mysql root password.

Solution: At this time, you can try to log in to the database using the empty password of the mysql default root account.

If an empty password appears again when logging in:

error. Then you need to modify the /phpmyadmin/config.inc.php file and find the following two lines

$cfg['Servers'][$i]['nopassword'] = false;

$cfg['Servers'][$i]['AllowNoPassword'] = false;


Change the two false to true and set

$cfg['Servers'][$i]['password'] = ''; Set the configuration file like this After that, phpmyadmin will allow logging in to the mysql database with an empty password. If you still cannot log in to phpmyadmin with an empty password again, please clear the cookies or close the original phpmyadmin login window and log in again with an empty password.

If it still shows that login with an empty password is prohibited, try entering a few characters as a password to see if you can log in successfully.


After logging in to the mysql server, change the mysql password in phpmyadmin as soon as possible.

http://www.bkjia.com/PHPjc/750100.html

truehttp: //www.bkjia.com/PHPjc/750100.htmlTechArticleThere are two ways to start Apache: Enter http://localhost in the browser and you will see a The page whose content is It works! is located in /Library/WebServer/Document...
Statement
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
What is the full form of PHP?What is the full form of PHP?Apr 28, 2025 pm 04:58 PM

The article discusses PHP, detailing its full form, main uses in web development, comparison with Python and Java, and its ease of learning for beginners.

How does PHP handle form data?How does PHP handle form data?Apr 28, 2025 pm 04:57 PM

PHP handles form data using $\_POST and $\_GET superglobals, with security ensured through validation, sanitization, and secure database interactions.

What is the difference between PHP and ASP.NET?What is the difference between PHP and ASP.NET?Apr 28, 2025 pm 04:56 PM

The article compares PHP and ASP.NET, focusing on their suitability for large-scale web applications, performance differences, and security features. Both are viable for large projects, but PHP is open-source and platform-independent, while ASP.NET,

Is PHP a case-sensitive language?Is PHP a case-sensitive language?Apr 28, 2025 pm 04:55 PM

PHP's case sensitivity varies: functions are insensitive, while variables and classes are sensitive. Best practices include consistent naming and using case-insensitive functions for comparisons.

How do you redirect a page in PHP?How do you redirect a page in PHP?Apr 28, 2025 pm 04:54 PM

The article discusses various methods for page redirection in PHP, focusing on the header() function and addressing common issues like "headers already sent" errors.

Explain type hinting in PHPExplain type hinting in PHPApr 28, 2025 pm 04:52 PM

Article discusses type hinting in PHP, a feature for specifying expected data types in functions. Main issue is improving code quality and readability through type enforcement.

What is PDO in PHP?What is PDO in PHP?Apr 28, 2025 pm 04:51 PM

The article discusses PHP Data Objects (PDO), an extension for database access in PHP. It highlights PDO's role in enhancing security through prepared statements and its benefits over MySQLi, including database abstraction and better error handling.

How to create API in PHP?How to create API in PHP?Apr 28, 2025 pm 04:50 PM

Article discusses creating and securing PHP APIs, detailing steps from endpoint definition to performance optimization using frameworks like Laravel and best security practices.

See all articles

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

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)