note 11700 added to Configuration
| From: | daniel at daniellampert dot com | Date: | Fri, 02 Mar 2001 20:48:53 +0000 |
| Subject: | note 11700 added to Configuration | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11795@lists.php.net to get a copy of this message | ||
In upgrading from PHP3 to PHP4, I first came in contact with the concepts of short form and long
form scripts. I had been writing scripts in PHP3 only in short form, i.e. <?if... echo... >
and hadn't realized it. So, after upgrading to PHP4, I was forced to do one of two things:
either set the "short_open_tag" in the php.ini file, or convert all of my scripts to long
form, i.e. <?php if... echo... >.
The latter seemed like a lot of work, so I did the former. I set entered this line in my php.ini
file:
short_open_tag = on
When I saw no results, I realized that I needed to use telnet to restart the server with this
command:
% restart_apache
Now I was getting somewhere, but it still wasn't over. My scripts had lots of little errors,
and I realized the final step that was needed. PHP4, on my system anyway, is strict about syntax,
and requires <? at the beginning of each line, and a ?> at the end of each line. Previously,
in PHP3, I began each line with <? but ended it with a mere >. No question mark. Now, that was
necessary.
When I replaced all <? ... > with <? ... ?>, then things started working.
http://www.php.net/manual/en/configuration.php