为什么有的人说可以直接在服务器上开发php?
我从经验上还是停留在本地开发完,上传服务器的流程
回复内容:
为什么有的人说可以直接在服务器上开发php?
我从经验上还是停留在本地开发完,上传服务器的流程
大公司很多都是这样的,服务器Linux,你有账号可以登上服务器,但是不能直接登,要先登上跳板机,然后再通过跳板机登上服务器,在这样的情况下,很多人就直接在服务器上用vim写喽。
vim作为编辑器之神,配置一下还是很好用的。
因为PHP不需要编译,直接可以运行。
没什么不可以,看实际情况。
大多数服务器都是 Linux 系统,而大多数 Linux 系统的桌面又不是很好用,没多少人用 Linux 当桌面。这就导致了很多情况下客户端和服务器并不是同样的环境,对于一些简单的网站,依赖很少,无非读写一下数据库,操作系统不一样也没多大问题。
但是如果网站的外部依赖很多,比如需要用到 Linux 上才有的一些功能,就不太容易保证开发用的机器和服务器的环境完全一样,这时直接在服务器上进行开发和测试就简单一点。
但是如果一个项目需要多人同时开发,在服务器上就不太好办了,因为有可能会覆盖掉其他的修改,这时最好的方案是用虚拟机,比如 Vagrant.
因为代码本身就是要在服务器上运行的啊,自己的笔记本环境和服务器差那么多,然后可能还有周边各种需要连接的工具系统通过windows都不好连的。
然后楼上说的几个人一起在一个服务器上开发其实也是没有问题的。
因为对于开发环境而言,每个人可以有自己的apache+mysql,只是端口不同而已。然后代码用git来做版本控制,可以定期送到测试服务器去测一下,然后对完成测试的版本打个标签。升级的时候就挑稳定的版本。
PS:要编译的语言就更加不会在自己的电脑上写了...要是环境出点差错要忙死了...
- 可以在服务器上直接写,不等于直接在生产环境上写.通常直接在上面写,也不会写到供用户使用的版本.
- 关于PHP,主流的php引擎都支持修改后立即看到结果,不管是解释型还是JIT型.
- 总有人觉得用vim+各种开源插件比IDE牛逼,在vim上你重构一个变量试试,把vim插件的自动补全和IDE里面的比比,vim只是一个文本编辑器而已.
可以在服务器上开发……。脚本语言
保证在能运行,在哪开发都不是问题。
似乎有这么一句话。在哪写代码不重要,重要是代码跑在哪。
只要能输入代码就可以写不是吗-- 只是直接在服务器上写不好而已,一般还是不这么做的把。
写php只需要一个编辑器,在哪里不能开发呢?
其实这种情况还挺多的。比如你刚写的一个应用几天之后出了个bug,你知道怎么改之后肯定直接在服务端把它改掉。再比如,你出去玩,突发灵感想写个shell,这时候在移动端写完之后传上去,再合适不过了。
说点题外话。
以前是搞系统管理的。
开发环境就是多人+PHP。
当然不像王子亭那样,土豪公司什么的,
但是如果一个项目需要多人同时开发,在服务器上就不太好办了,因为有可能会覆盖掉其他的修改,这时最好的方案是用虚拟机,比如 Vagrant。
毕竟小项目小地方,
就地取材,有时候个人电脑VMplayer(这东西比较良心,不用设置端口转发之类的就能直接SSH和VNC进去。)有人就会进去用VIM,也就是题主说的直接在服务器上开发php。
第二,有时候会开个服务器账号umask和group ID、ldap之类的黑科技,然后多账户ssh进去git提交。
第三,有时候就是用svn的post-commit脚本和svn export这种黑科技多人提交多人同时修改。
当然服务器上开发,一般说的就是SSH+VIM+git...
感觉好像这话就是 能干这事,然后被你理解成 这样做很好很效率的样子。

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.

In PHP, use the clone keyword to create a copy of the object and customize the cloning behavior through the \_\_clone magic method. 1. Use the clone keyword to make a shallow copy, cloning the object's properties but not the object's properties. 2. The \_\_clone method can deeply copy nested objects to avoid shallow copying problems. 3. Pay attention to avoid circular references and performance problems in cloning, and optimize cloning operations to improve efficiency.

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

Key players in HTTP cache headers include Cache-Control, ETag, and Last-Modified. 1.Cache-Control is used to control caching policies. Example: Cache-Control:max-age=3600,public. 2. ETag verifies resource changes through unique identifiers, example: ETag: "686897696a7c876b7e". 3.Last-Modified indicates the resource's last modification time, example: Last-Modified:Wed,21Oct201507:28:00GMT.

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP is a server-side scripting language used for dynamic web development and server-side applications. 1.PHP is an interpreted language that does not require compilation and is suitable for rapid development. 2. PHP code is embedded in HTML, making it easy to develop web pages. 3. PHP processes server-side logic, generates HTML output, and supports user interaction and data processing. 4. PHP can interact with the database, process form submission, and execute server-side tasks.

PHP has shaped the network over the past few decades and will continue to play an important role in web development. 1) PHP originated in 1994 and has become the first choice for developers due to its ease of use and seamless integration with MySQL. 2) Its core functions include generating dynamic content and integrating with the database, allowing the website to be updated in real time and displayed in personalized manner. 3) The wide application and ecosystem of PHP have driven its long-term impact, but it also faces version updates and security challenges. 4) Performance improvements in recent years, such as the release of PHP7, enable it to compete with modern languages. 5) In the future, PHP needs to deal with new challenges such as containerization and microservices, but its flexibility and active community make it adaptable.

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function