


Overview 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/data
In 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
/var/mysql/mysql.sock
<code>mysql.default_socket = /tmp/mysql.sock<br /></code>
phpMyAdmin is a program developed in PHP to manage MySQL. It is very popular and practical. Being able to use phpMyAdmin to manage MySQL is a very effective way to test the effectiveness of the previous steps. This is mainly applied in the recent research on
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.
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

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.

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

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,

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.

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

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.

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.

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


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

Dreamweaver CS6
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use

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

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