网站制作教程之如何运行php的第一个程序
经过一连传的安装和设定,有人一定会问:“这样能运行PHP了吗?”,下面就来运行第一个网站制作PHP程序。
(1)启动Zend Studio,如图2.19所示。
![启动Zend Studio](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
(2)第一次启动Zend Studio时,将弹出如图2.20所示的设置工作空间的窗口。
![设置工作空间](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
(3)选择"File"|"New"|"Local PHP Project"命令,如图2.21所示。
![选择菜单](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
(4)在弹出的对话框中的 "Project Name”文本框中输入“HelloWorid",在"Location"右侧输入Apache中设置的根目录,如图2.22所示。
![创建新项目](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
(5)单击"Finish"按钮即可创建新的项目,如图2.23所示,在左侧的“PHP Explorer”中列出了项目中的文件。
![新的项目](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
(6)新建的项日自动添加了一个名为“index.php’的文件,双击打开该文件,在文件中输入下列代码。
(7)按快捷键"Ctrl+S"或选择"File"|"Save"命令进行保存。再按"Ctrl+F11”键运行代码,这时将显示如图2.24所示的对话框,选择通过哪种方式运行代码。
![选择代码运行方式](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
(8)选择“PHP Web Application”以网页方式来运行PHP代码,单击“OK”按钮,即可看到如图2.25所示的运行结果,这是以一个内置浏览器的方式显示代码的运行结果。
![运行结果](https://web.eq.sd.cn/wp-content/themes/justnews6.0.1/themer/assets/images/lazy.png)
激动人心的时刻总是那么短,能让PHP说一句"Hello World”只是一小步,也对于还没接触过PHP的人来说是一大步啊!
网站制作教程之如何运行php的第一个程序非原创文章,如若转载,请注明出处:https://web.eq.sd.cn/4_2361.html