简体   繁体   中英

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.

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); .

What other best practices should be incorporated in a PHP app for the best cross-server compatability?

Just a few hints, from the top of my head

The class { __constructor } is deprecated.
Dont use 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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