search
HomeBackend DevelopmentPHP Tutorialxampp的装配和thinkphp的部署

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]# 
? ?其中,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]# 

? ? 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);

? ??

? ? 测试: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

? ??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
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
PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

How to make PHP applications fasterHow to make PHP applications fasterMay 12, 2025 am 12:12 AM

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

PHP Performance Optimization Checklist: Improve Speed NowPHP Performance Optimization Checklist: Improve Speed NowMay 12, 2025 am 12:07 AM

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

PHP Dependency Injection: Improve Code TestabilityPHP Dependency Injection: Improve Code TestabilityMay 12, 2025 am 12:03 AM

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

PHP Performance Optimization: Database Query OptimizationPHP Performance Optimization: Database Query OptimizationMay 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

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 Article

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),