简体   繁体   English

AWS EC2 php文件

[英]AWS EC2 php files

I noticed my php files, when transferred to EC2, don't work unless the have the "php" in the opening <? php...?> 我注意到我的php文件在传输到EC2时无法正常工作,除非开头带有“ php” <? php...?> <? php...?>

A lot of my files were written without it as <? ...?> 我的许多文件都写为<? ...?> <? ...?>

Is there an easy setting to allow the way I've written them, or will I have to go change all? 是否有一个简单的设置可以允许我编写它们,或者我将不得不全部更改?

Thanks 谢谢

You can enable PHP's shortened open tags in PHP.INI by setting short_open_tag to 1 . 您可以通过将short_open_tag设置为1来在PHP.INI中启用PHP的缩短的打开标记。 Presumably this had been done on your development system 大概这是在您的开发系统上完成的

However, this is discouraged in the PHP reference which you can find here and here 但是,PHP参考中不鼓励这样做,您可以在此处此处找到

You alternative is to change everything to <?php... 您可以选择将所有内容更改为<?php...

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

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