简体   繁体   English

如何使我的开源PHP应用程序跨服务器?

[英]How can I make my open-source PHP app cross-server?

I have a PHP program using MySQL that I will be making open-source, including a simple installer, and I want to make it as easy to install on any server with PHP4 or 5 and MySQL 4 as possible. 我有一个使用MySQL的PHP​​程序,它将成为开放源代码,包括一个简单的安装程序,并且我想使其尽可能容易地安装在任何装有PHP4或5和MySQL 4的服务器上。

I've included an installer to make it user-friendly, but I need to know what are the things I can do to make it most likely to install on every server. 我提供了一个安装程序,以使其易于使用,但我需要知道要做什么才能使其最有可能安装在每台服务器上。

I'll start: I've made sure to use full PHP tags (not short) like this <?php ?> and to make sure all variables are declared prior to using them, like so $nVar = (isset($_POST['nVar']) ? $_POST['nVar'] : NULL); 我将开始:我确保使用完整的PHP标记(不短),例如<?php ?> ,并确保在使用它们之前声明所有变量,例如$nVar = (isset($_POST['nVar']) ? $_POST['nVar'] : NULL); .

What other best practices should be incorporated in a PHP app for the best cross-server compatability? 为了获得最佳的跨服务器兼容性,PHP应用程序还应结合其他哪些最佳实践?

Just a few hints, from the top of my head 从我的头顶上只是一些提示

The class { __constructor } is deprecated. 不推荐使用{__constructor}类。
Dont use GLOBAL 不要使用GLOBAL
Use split and join 使用拆分和合并
Watch out for file magic byte recognition functions 注意文件魔术字节识别功能
The get_class get_parent_class alphanumerical changed to accept camelcasing - use strtolower on returned value before comparing 将get_class get_parent_class字母数字更改为接受驼峰式-比较之前对返回值使用strtolower

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM