Home Backend Development PHP Tutorial xampp的装配和thinkphp的部署

xampp的装配和thinkphp的部署

Jun 13, 2016 pm 12:24 PM
php protected redis root xampp

xampp的安装和thinkphp的部署

一、xampp的安装

1、xampp的下载:

https://www.apachefriends.org/zh_cn/index.html

xampp for linux v5.6.12

下载的文件为:xampp-linux-x64-5.6.12-0-installer.run

2、安装

?其他权限无法安装。切换到linux的root权限下,执行 ./xampp-linux-x64-5.6.12-0-installer.run

3、启动xampp

? ??[[email protected] lampp]# /opt/lampp/lampp start

Starting XAMPP for Linux 5.6.12-0...

XAMPP: Starting Apache...ok.

XAMPP: Starting MySQL...ok.

XAMPP: Starting ProFTPD...ok.

? ?

4、访问xampp

? ? http://localhost/

?

? ? 外部访问还要关掉防火墙 service iptables stop

? ? http://192.168.0.106/

? ? phpinfo : ? http://192.168.0.106/dashboard/phpinfo.php

?

二、thinkphp的部署

? ? 1、下载thinkphp的liunux安装文件

? ? ?http://www.thinkphp.cn/ ?下载thinkphp_3.2.3_full.zip

? ? 2、部署到xampp中

? ? 解压到/opt/lampp/htdocs/thinkphp

? ? 3、给thinkphp目录下的Application添加权限

? ? 如果不添加权限访问thinkphp会出现如下提示:应用目录[./Application/]不可写,目录无法自动生成!

? ??[[email protected] lampp]# chmod a+w Application/

? ? 4、访问thinkphp?

? ? ?http://192.168.0.106/thinkphp

? ?

?三、php安装redis插件

? ? 1、下载redis插件

? ? ?http://www.redis.io/clients

? ? ?下载php语言的插件phpredis:phpredis-develop.zip

? ? ?解压到cd /home/hadoop/temp/phpredis-develop

? ? ?2、生成安装文件并安装

? ? ?2.1 生成configure文件:/opt/lampp/bin/phpize

? ? 可能需要安装m4和autoconf文件,详见http://blog.csdn.net/21aspnet/article/details/7471574

? ? ?2.2 make

? ? ?2.3 make install

? ? ?[[email protected] phpredis-develop]# make install

? ? ?Installing shared extensions: ? ? /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/

? ? ? 2.4 查看生成的redis插件

? ? ??

[[email protected] phpredis-develop]# cd /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/[[email protected] no-debug-non-zts-20131226]# lltotal 2148-rwxr-xr-x. 1 root root   49312 Aug 25 08:52 mssql.so-rwxr-xr-x. 1 root root  156856 Aug 25 08:52 oci8.so-rwxr-xr-x. 1 root root  143976 Aug 25 08:52 opcache.so-rwxr-xr-x. 1 root root   20496 Aug 25 08:52 pdo_dblib.so-rwxr-xr-x. 1 root root  132480 Aug 25 08:52 pgsql.so-rwxr-xr-x. 1 root root   42960 Aug 25 08:52 radius.so-rwxr-xr-x. 1 root root 1423553 Aug 29 19:47 redis.so-rwxr-xr-x. 1 root root  206408 Aug 25 08:52 xdebug.so[[email protected] no-debug-non-zts-20131226]# 
Copy after login
? ?其中,redis.so就是生成的redis插件。

?

? ?3、配置redis插件

? ??[[email protected] etc]# pwd

? ? /opt/lampp/etc

? ? [[email protected] etc]# vi php.ini

? ? 添加:extension=“redis.so”

? ?4、重启 php(xampp)。

? ?

[[email protected] lampp]# ./xampp restartRestarting XAMPP for Linux 5.6.12-0...XAMPP: Stopping Apache...ok.XAMPP: Stopping MySQL...ok.XAMPP: Stopping ProFTPD...ok.XAMPP: Starting Apache...ok.XAMPP: Starting MySQL...ok.XAMPP: Starting ProFTPD...ok.[[email protected] lampp]# 
Copy after login

? ? 5、查看redis插件是否安装成功

? ? ?http://192.168.0.106/dashboard/phpinfo.php

? ? ?可以看出列出了redis的列表

? ? 6、安装redis程序,写demo测试。

? ? redis的安装这里不再赘述,自行查阅安装。默认端口即可。

? ? htdocs/demo/redisdemo.php:

<?php$redis = new Redis();$redis->connect("127.0.0.1");$redis->set("name","leh");$data=$redis->get("name");echo($data);
Copy after login

? ??

? ? 测试:http://192.168.0.106/demo/redisdemo.php

? ? leh

?

?四、安装thrift,实现php访问hbase

? ? ? 1、下载thrift。

? ? ? thrift-0.9.2.tar.gz

? ? ?2、安装配置thrift

? ? ?首先运行根目录下的 $ ./bootstrap.sh,用于生成configure脚本?

? ? ?如果下载的直接是一个tarball,则跳过此步骤,直接运行软件根目录下的configure脚本?

? ??

./bootstrap.sh./configuremakemake install
Copy after login

? ??3、复制thrift-0.9.2/lib/php到相应的php web目录htdocs/demo/hbasethrift

? ? 4、生成php与hbase接口文件

#/home/hadoop/software/thrift/bin/thrift --gen php /home/hadoop/temp/hbase/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift

#(根据自己的目录设置)

生成目录文件: /home/hadoop/temp/gen-php/Hbase

? ?有文件: Hbase.php,Hbase_types.php

? ?把Hbase.php,Hbase_types.php copy到:web目录/opt/lamp/php/hbasethrift/libs/packages/Hbase/

?

?

?

?

?

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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

The Continued Use of PHP: Reasons for Its Endurance The Continued Use of PHP: Reasons for Its Endurance Apr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

How to use the Redis cache solution to efficiently realize the requirements of product ranking list? How to use the Redis cache solution to efficiently realize the requirements of product ranking list? Apr 19, 2025 pm 11:36 PM

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...

Laravel8 optimization points Laravel8 optimization points Apr 18, 2025 pm 12:24 PM

Laravel 8 provides the following options for performance optimization: Cache configuration: Use Redis to cache drivers, cache facades, cache views, and page snippets. Database optimization: establish indexing, use query scope, and use Eloquent relationships. JavaScript and CSS optimization: Use version control, merge and shrink assets, use CDN. Code optimization: Use Composer installation package, use Laravel helper functions, and follow PSR standards. Monitoring and analysis: Use Laravel Scout, use Telescope, monitor application metrics.

Redis's Role: Exploring the Data Storage and Management Capabilities Redis's Role: Exploring the Data Storage and Management Capabilities Apr 22, 2025 am 12:10 AM

Redis plays a key role in data storage and management, and has become the core of modern applications through its multiple data structures and persistence mechanisms. 1) Redis supports data structures such as strings, lists, collections, ordered collections and hash tables, and is suitable for cache and complex business logic. 2) Through two persistence methods, RDB and AOF, Redis ensures reliable storage and rapid recovery of data.

What should I do if the Redis cache of OAuth2Authorization object fails in Spring Boot? What should I do if the Redis cache of OAuth2Authorization object fails in Spring Boot? Apr 19, 2025 pm 08:03 PM

In SpringBoot, use Redis to cache OAuth2Authorization object. In SpringBoot application, use SpringSecurityOAuth2AuthorizationServer...

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

Title: How to use Composer to solve distributed locking problems Title: How to use Composer to solve distributed locking problems Apr 18, 2025 am 08:39 AM

Summary Description: Distributed locking is a key tool for ensuring data consistency when developing high concurrency applications. This article will start from a practical case and introduce in detail how to use Composer to install and use the dino-ma/distributed-lock library to solve the distributed lock problem and ensure the security and efficiency of the system.

See all articles