473,378 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Why ini_set( "short_open_tag", 1 ) didn't work?

ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'

Nov 23 '06 #1
6 32464
howa wrote:
ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'
Hi,

ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of the
script that contains that ini_set().

And that is good. If everybody (on a shared hosting environment) could
change the real php.ini (by using ini_set), development would become very
troublesome because php.ini changes a lot. :-)

Regards,
Erwin Moller

PS: Overwriting short_open_tags is not very usefull, since this setting
should be known by PHP before parsing the php-file.
It is better to ALWAYS use <?php instead of relying on short open tags.
Nov 23 '06 #2
..oO(howa)
>ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'
'short_open_tag' is marked as PHP_INI_PERDIR, which means you can't
change it with ini_set(). Just use <?php and you'll be fine.

Micha
Nov 23 '06 #3

Erwin Moller ¼g¹D¡G
howa wrote:
ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'

Hi,

ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of the
script that contains that ini_set().
well, how do I know which value in php.ini can be changed, and which
not?

seems can't find on the php.com

Nov 24 '06 #4

Erwin Moller ¼g¹D¡G
howa wrote:
ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'

Hi,

ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of the
script that contains that ini_set().
well, how do I know which value in php.ini can be changed, and which
not?

seems can't find on the php.com

Nov 24 '06 #5
howa wrote:
>
Erwin Moller ???
>howa wrote:
ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'

Hi,

ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of
the script that contains that ini_set().

well, how do I know which value in php.ini can be changed, and which
not?

seems can't find on the php.com
Look again?

http://nl3.php.net/manual/en/ini.php#ini.list

Pay attention to the column named 'changable'.

And always test.
If you change some ini value, simply check inyour srcipt if it changed
succesfully.

It is considered (by me) good programming practice to have a file included
above all scripts (or at least the entrypoints of your site).
In this file you check a few thing that are important to the functioning of
your application.
Eg: are magic quotes on? Can you change the include-directory? etc.
Fail if some assumptions are not met with a clear complaint (eg: This
application needs mysqli to run, not mysql! mysqli not found.).

This has the advantage that when you change ISP or update your server, or
change to a newer version of PHP, your scripts will fail with a clear
complaint instead of failing in unpredicted ways.
Note: Some of these settings can NOT be changed when running in save mode.

Regards,
Erwin Moller
Nov 24 '06 #6

Erwin Moller ¼g¹D¡G
howa wrote:

Erwin Moller ???
howa wrote:

ini_set( "short_open_tag", 1 );

phpinfo();

still showing 'off'

Hi,

ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of
the script that contains that ini_set().
well, how do I know which value in php.ini can be changed, and which
not?

seems can't find on the php.com

Look again?

http://nl3.php.net/manual/en/ini.php#ini.list

Pay attention to the column named 'changable'.

And always test.
If you change some ini value, simply check inyour srcipt if it changed
succesfully.

It is considered (by me) good programming practice to have a file included
above all scripts (or at least the entrypoints of your site).
In this file you check a few thing that are important to the functioning of
your application.
Eg: are magic quotes on? Can you change the include-directory? etc.
Fail if some assumptions are not met with a clear complaint (eg: This
application needs mysqli to run, not mysql! mysqli not found.).

This has the advantage that when you change ISP or update your server, or
change to a newer version of PHP, your scripts will fail with a clear
complaint instead of failing in unpredicted ways.
Note: Some of these settings can NOT be changed when running in save mode.

Regards,
Erwin Moller
Thanks.

Nov 24 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Honza K. | last post by:
Why this works: $pod = "<//body><//html>"; and this gives me a Parse Error: $pod = "</body></html>"; ?? I used the variable $pod for including the string into *.htm file by using FPutS()...
0
by: David Allison | last post by:
Foriegn Key Required - Yes - no wonder it didnt work. Now they tell me. -- Dave Allison
1
by: Lucrefy | last post by:
i have a winform program that need automatic upgrade.I see and follow an article£¨http://windowsforms.net/articles/appupdater.aspx£© to build my own program,but it didnt work. show me a error...
0
by: Lucrefy | last post by:
i have a winform program that need automatic upgrade.I see and follow an article£¨http://windowsforms.net/articles/appupdater.aspx£© to build my own program,but it didnt work. show me a error...
4
by: K.N.Ranjit | last post by:
Hi to all friends out there.I am presently working in TCS and I am supposed to do the work given to me in line cordinates using VB.net.But over here I face a problem (ie) I want my coordinate...
9
by: nichas | last post by:
I tried to use #include<iostream> in visual C++ compiler but then it didnt work but i see this is the way it is being mentioned in C++ primer by lippman and lajoie.. where is the problem.. Do...
5
by: taylan | last post by:
Hi Gurus, I have been working on my site pas few weeks almost 12 hrs a day. I came to a point and got stuck. I am hoping somebody can show me the way. What I want to do is: If a new user is visiting...
0
by: shaiamiel | last post by:
Hello, Im looking for a VOIP SDK that will be appliciable to both PC & Pocket PCs using the .net framework & c#. Does anyone know such thing? I tried bear soft's SDK but it didnt work so well...
0
by: osin | last post by:
Hello everyone, I need to generate an XML file whose element would be an active link (triggering a PERL script). The only tool I've found which is capable of doing it is Xlink. The problem is...
7
by: XxChelseaxX | last post by:
# count the divisors of a number def countDivisors(n): count = 0 for possible in range(1, n): if n % possible == 0: count = count+possible # print Perfect...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.