搜索
首页后端开发php教程Linux下的PHP开发环境_PHP教程

Linux下的PHP开发环境_PHP教程

Jul 20, 2016 am 11:14 AM
eclipselinuxphp安装开发环境遇到问题

 

一、Eclipse PHP

 

先试着安装Eclipse,遇到各种问题,把workspace目录放到/var/www/html目录下,解决了一些问题。但最终还是没解决。后来又安装了Zend提供的Eclipse,问题依旧。放弃!

 

Installing Eclipse PHP

 

Install Zend plugin:

 

http://code.google.com/p/zend-sdk/wiki/ZendSdkEclipsePlugin

 

 

 

二、NetBeans

 

看到网上有很多网友盛赞netbeans,于是安装了一个

 

1. 安装NetBeans

 

 

 

1)下载sh文件,

 

https://netbeans.org/downloads/

 

2) 执行安装

 

下载完后执行: chmod +x netbeans-7.3-linux.sh; ./ netbeans-7.3-linux.sh;

 

开始安装,提示jdk找不到,后来在/usr/jvm/lib/jd****,找到好几个版本,但netbeans还是提示版本过低。

 

于是:下载了jdk最新版jdk_1.7.0_21。然后一路安装下去。

 

3)运行

 

安装完后,到安装目录(默认:/usr/local/netbeans-7.3/bin/)下,双击netbeans图标启动netbeans

 

4)创建一个PHP项目

 

创建后,source folder默认目录是在/var/www下,而不是/var/www/html,更改httpd conf 文件中有“/var/www/html”的两处,为““/var/www”。即可正常运行。

 

或者不改httpd conf文件,更改项目对应的source folder和project folder也可。

 

 

 

Debuger好像还有点慢,等等看如何,再等很久,还是waiting,呵呵,看来有问题。这么解决:

 

 

 

2. 安装xdebug

 

https://github.com/xdebug/xdebug

 

 

 

1) Unpack the tarball: tar -xzf xdebug-2.2.x.tgz.  Note that you do
not need to unpack the tarball inside the PHP source code tree.
Xdebug is compiled separately, all by itself, as stated above.

2) cd xdebug-2.2.x

3) Run phpize: phpize
   (or /path/to/phpize if phpize is not in your path).

4) ./configure --enable-xdebug (or: ../configure --enable-xdebug
   --with-php-config=/path/to/php-config if php-config is not in your
   path)

5) Run: make

6) cp modules/xdebug.so /to/wherever/you/want/it

7) add the following line to php.ini:
   zend_extension="/wherever/you/put/it/xdebug.so"

 

   #The following is my config:

 

   zend_extension = /usr/lib64/xdebug.so
   xdebug.remote_enable=on
   xdebug.remote_log="/var/log/xdebug.log"
   xdebug.remote_host=localhost
   xdebug.remote_handler=dbgp
   xdebug.remote_port=9000

 


 

8) Restart your webserver.(since php is part of webserver)

9) Write a PHP page that calls "phpinfo();" Load it in a browser and
   look for the info on the xdebug module.  If you see it, you have been
   successful!

 

 

 

按照上述步骤完成后,发现phpinfo页面多了xdeug的表格,表明成功

 

但是遗憾的是netbeans的debug按钮们依然是灰色的。无法debug;查看日志:/var/log/httpd/error_log,发现里面竟然有selinux,到/etc/sysconfig/security里disabled掉selinux,然后重启系统。还是没解决。

 

 

 

把php.ini文件中的端口改为9001,重启httpd;然后把netbeans的端口也改为9001。ok!

 

很奇怪,于是又把php.ini和netbeans--debug--options-php-debug中的端口改回为9000. 也可以正常工作了。

 

至此,netbeans下的php运行,debug都ok。

 

本文转自 Linux下的PHP开发环境

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/440314.htmlTechArticle一、Eclipse PHP 先试着安装Eclipse,遇到各种问题,把workspace目录放到/var/www/html目录下,解决了一些问题。但最终还是没解决。后来又安装了...
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
PHP如何识别用户的会话?PHP如何识别用户的会话?May 01, 2025 am 12:23 AM

phpientifiesauser'ssessionusessessionSessionCookiesAndSessionIds.1)whiwSession_start()被称为,phpgeneratesainiquesesesessionIdStoredInacookInAcookInamedInAcienamedphpsessidontheuser'sbrowser'sbrowser.2)thisIdAllowSphptptpptpptpptpptortoreTessessionDataAfromtheserverMtheserver。

确保PHP会议的一些最佳实践是什么?确保PHP会议的一些最佳实践是什么?May 01, 2025 am 12:22 AM

PHP会话的安全可以通过以下措施实现:1.使用session_regenerate_id()在用户登录或重要操作时重新生成会话ID。2.通过HTTPS协议加密传输会话ID。3.使用session_save_path()指定安全目录存储会话数据,并正确设置权限。

PHP会话文件默认存储在哪里?PHP会话文件默认存储在哪里?May 01, 2025 am 12:15 AM

phpsessionFilesArestoredIntheDirectorySpecifiedBysession.save_path,通常是/tmponunix-likesystemsorc:\ windows \ windows \ temponwindows.tocustomizethis:tocustomizEthis:1)useession_save_save_save_path_path()

您如何从PHP会话中检索数据?您如何从PHP会话中检索数据?May 01, 2025 am 12:11 AM

ToretrievedatafromaPHPsession,startthesessionwithsession_start()andaccessvariablesinthe$_SESSIONarray.Forexample:1)Startthesession:session_start().2)Retrievedata:$username=$_SESSION['username'];echo"Welcome,".$username;.Sessionsareserver-si

您如何使用会议来实施购物车?您如何使用会议来实施购物车?May 01, 2025 am 12:10 AM

利用会话构建高效购物车系统的步骤包括:1)理解会话的定义与作用,会话是服务器端的存储机制,用于跨请求维护用户状态;2)实现基本的会话管理,如添加商品到购物车;3)扩展到高级用法,支持商品数量管理和删除;4)优化性能和安全性,通过持久化会话数据和使用安全的会话标识符。

您如何在PHP中创建和使用接口?您如何在PHP中创建和使用接口?Apr 30, 2025 pm 03:40 PM

本文解释了如何创建,实施和使用PHP中的接口,重点关注其对代码组织和可维护性的好处。

crypt()和password_hash()有什么区别?crypt()和password_hash()有什么区别?Apr 30, 2025 pm 03:39 PM

本文讨论了PHP中的crypt()和password_hash()之间的差异,以进行密码哈希,重点介绍其实施,安全性和对现代Web应用程序的适用性。

如何防止PHP中的跨站点脚本(XSS)?如何防止PHP中的跨站点脚本(XSS)?Apr 30, 2025 pm 03:38 PM

文章讨论了通过输入验证,输出编码以及使用OWASP ESAPI和HTML净化器之类的工具来防止PHP中的跨站点脚本(XSS)。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

Atom编辑器mac版下载

Atom编辑器mac版下载

最流行的的开源编辑器

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器