Home > Backend Development > PHP Tutorial > ubuntu 中geany调用浏览器展示php文件

ubuntu 中geany调用浏览器展示php文件

WBOY
Release: 2016-06-13 11:50:28
Original
1464 people have browsed it

ubuntu 中geany调用浏览器显示php文件

1.网站根目录为:/var/www

先要获取根目录的读写权限:sudo chmod 777 /var/www

2.打开geany

1)Project -> New -> Name = web, Base path = /var/www/web/

2)Build -> Set Build Commands -> Execute Commands -> Execute = php -S localhost:80 & sensible-browser localhost:80/web%f

说明:1)是新建一个项目,名字为web,所在路径为:/var/www/web ;2)是设置生成命令,注意两点:1.由于我没有更改默认的端口,使用的是80,这个根据实际情况更改。2.最后localhost:80/web%f 中间有个web,因为你新建的文件都是在web目录下,以后如果新建其他的项目,web要改成相应的名称。

3.设置完成后,就可以新建一个index.php文件测试了。

<?php ?>    <title>Index</title>   <meta charset="utf-8">    <h1><?php echo "This is the Index Page"; ?></h1> 
Copy after login
按F5运行,此时会打开一个命令窗口,同时系统默认浏览器会打开。


参考:http://www.ojambo.com/geany-php-web-server

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template