[英]Drupal6 - Debug on the page
Hi 你好
I am going to change the template file (page.tpl.php), I need to write the code on this file, then upload to server, after that refresh the browser to see the result. 我要更改模板文件(page.tpl.php),我需要在该文件上编写代码,然后上传到服务器,然后刷新浏览器以查看结果。
Is there any other way to do this thing conveniently? 还有其他方法可以方便地执行此操作吗?
大多数人在本地计算机上设置测试服务器,以便他们可以直接对其进行编辑,然后在完成后将其上传到真实服务器。
If you are using Ubuntu (or any modern Gnome or KDE-based linux-system) you can very easily "mount" remote servers over FTP or SSH (or a range of other protocols). 如果您使用的是Ubuntu(或任何现代的Gnome或基于KDE的现代linux系统),则可以非常容易地通过FTP或SSH(或一系列其他协议)“挂载”远程服务器。
That allows you to work directly on remote: open files with any editor, save it, as if it were a local file and so on. 这样一来,您就可以直接在远程上工作:使用任何编辑器打开文件,将其保存为本地文件,依此类推。
http://blog.ashfame.com/2011/01/connect-ftp-server-ubuntu-without-client/ http://blog.ashfame.com/2011/01/connect-ftp-server-ubuntu-without-client/
That is a good way to develop, if your development environment is set up remote. 如果您的开发环境是远程设置的,那是开发的一种好方法。 However, developing on your live environment is generally a bad idea:
但是,在您的生活环境中进行开发通常不是一个好主意:
I suggest you to setup a local development server using the *AMP stack ( LAMP for linux, MAMP for Mac OS or XAMPP for Windows ) server, so that you are able to quickly edit and test files. 建议您使用* AMP堆栈(Linux的LAMP ,Mac OS的MAMP或Windows的XAMPP )服务器设置本地开发服务器,以便能够快速编辑和测试文件。
Also usually is not advised to directly develop on a production system, as you could produce service downtime due to your developing. 通常也不建议直接在生产系统上进行开发,因为开发可能会导致服务中断。
Some useful resources you can find are: 您可以找到一些有用的资源:
After development you could use a tool like scp or Filezilla ( for FTP ) to upload your file to the server. 开发之后,您可以使用诸如scp或Filezilla (用于FTP)之类的工具将文件上传到服务器。
Happy coding! 编码愉快! :)
:)
On Windows Xampp is a good choice: http://www.apachefriends.org/de/xampp.html 在Windows上,Xampp是一个不错的选择: http : //www.apachefriends.org/de/xampp.html
Please note if you are on 64bit Windows machine you cannot debug. 请注意,如果您使用的是64位Windows计算机,则无法调试。 Xdebug nor ZendDebugger are working with the any of the xampp versions.
Xdebug或ZendDebugger都可以使用任何xampp版本。
See also the Drupal for Firebug extension - https://addons.mozilla.org/en-US/firefox/addon/drupal-for-firebug/ - to use this, you must also install the Drupal module on your Drupal site, from the source linked there. 又见Drupal的Firebug的扩展- https://addons.mozilla.org/en-US/firefox/addon/drupal-for-firebug/ -使用这个,你还必须在您的Drupal站点安装Drupal的模块,从源链接在那里。 This will give you easy access to the content of variables by simply including in the template file (between PHP tags)
firep($myvar);
只需在模板文件中(PHP标记之间)
firep($myvar);
,即可轻松访问变量的内容firep($myvar);
This will add to the convenience - the variable dump won't be in the middle of a lot of HTML, sometimes obscured - but will be nice, cleanly displayed in the Firebug panel at the bottom of your browser. 这将增加便利性-变量转储不会出现在很多HTML的中间,有时甚至会被遮盖住-但是会很好,干净地显示在浏览器底部的Firebug面板中。
If you have shell access to the server, you can edit the file via vi or emacs. 如果您具有对服务器的Shell访问权限,则可以通过vi或emacs编辑文件。 If you do not have shell access, there are text editors out there that can treat remote files like they are local.
如果您没有外壳访问权限,则可以使用文本编辑器将远程文件视为本地文件。 My personal favorite is Ultraedit .
我个人最喜欢的是Ultraedit 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.