473,800 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WAMP5, short tags and CLI PHP issue

I installed WAMP5 on my WinXP box which works just fine on its own,
and I found a practical way of handling my short-tag PHP script
via .htaccess:

php_flag short_open_tag on

To ensure my literally hundreds of PHP scripts will all function
within the WAMP5 architecture.

However, there is a case of a series of installer scripts written in
PHP that are not meant to be run except as CLI PHP that obviously will
not benefit from .htaccess, furthermore, changing the CLI PHP scripts
from short to long tags is very much not an option due to both the
volume of scripts and code complexity as patterns of '<' . '?..' or
"<" . "?.." or '<' . "?.." will exist within scripts alongside the
dynamic generation of other PHP scripts by other CLI PHP scripts.

Realizing that .htaccess is not usable for CLI PHP nor can I use
ini_set(), and the business requirement of these scripts being fully
portable installer scripts (tested so far successfully in Win XP/
Apache 1.33/PHP 5.2.0, Win XP/Apache 2.0.53/PHP 4.3.9, WinXP/Apache
2.0.53/PHP 5.0.4, Linux/Apache 2.0.54/PHP 4.3.9), what other last-
minute portable tricks would you suggest (other than the obvious:
changing php.ini, which I can't do on certain remote host services
this app will reside in)?

Phil

Jan 29 '07 #1
8 5674
comp.lang.php wrote:
I installed WAMP5 on my WinXP box which works just fine on its own,
and I found a practical way of handling my short-tag PHP script
via .htaccess:

php_flag short_open_tag on

To ensure my literally hundreds of PHP scripts will all function
within the WAMP5 architecture.

However, there is a case of a series of installer scripts written in
PHP that are not meant to be run except as CLI PHP that obviously will
not benefit from .htaccess, furthermore, changing the CLI PHP scripts
from short to long tags is very much not an option due to both the
volume of scripts and code complexity as patterns of '<' . '?..' or
"<" . "?.." or '<' . "?.." will exist within scripts alongside the
dynamic generation of other PHP scripts by other CLI PHP scripts.

Realizing that .htaccess is not usable for CLI PHP nor can I use
ini_set(), and the business requirement of these scripts being fully
portable installer scripts (tested so far successfully in Win XP/
Apache 1.33/PHP 5.2.0, Win XP/Apache 2.0.53/PHP 4.3.9, WinXP/Apache
2.0.53/PHP 5.0.4, Linux/Apache 2.0.54/PHP 4.3.9), what other last-
minute portable tricks would you suggest (other than the obvious:
changing php.ini, which I can't do on certain remote host services
this app will reside in)?

Phil
Hi Phil,

Are you using php-cgi.exe ?
If so type:
php-cgi.exe -h for help

It lists amongst others the -d option.
With this option you can tell PHP beforehand to set a certain value for
anything that you might encounter in php.ini, like short_open_tags .

If this does for you what you want, you only have to change the way you call
php-cgi instead of changing all the scripts.

Hope that helps.
Good luck. (Migrations are always a pain.)

Regards,
Erwin Moller

Jan 29 '07 #2


On Jan 29, 9:28 am, Erwin Moller
<since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
comp.lang.php wrote:
I installed WAMP5 on my WinXP box which works just fine on its own,
and I found a practical way of handling my short-tag PHP script
via .htaccess:
php_flag short_open_tag on
To ensure my literally hundreds of PHP scripts will all function
within the WAMP5 architecture.
However, there is a case of a series of installer scripts written in
PHP that are not meant to be run except as CLI PHP that obviously will
not benefit from .htaccess, furthermore, changing the CLI PHP scripts
from short to long tags is very much not an option due to both the
volume of scripts and code complexity as patterns of '<' . '?..' or
"<" . "?.." or '<' . "?.." will exist within scripts alongside the
dynamic generation of other PHP scripts by other CLI PHP scripts.
Realizing that .htaccess is not usable for CLI PHP nor can I use
ini_set(), and the business requirement of these scripts being fully
portable installer scripts (tested so far successfully in Win XP/
Apache 1.33/PHP 5.2.0, Win XP/Apache 2.0.53/PHP 4.3.9, WinXP/Apache
2.0.53/PHP 5.0.4, Linux/Apache 2.0.54/PHP 4.3.9), what other last-
minute portable tricks would you suggest (other than the obvious:
changing php.ini, which I can't do on certain remote host services
this app will reside in)?
PhilHi Phil,

Are you using php-cgi.exe ?
If so type:
php-cgi.exe -h for help

It lists amongst others the -d option.
With this option you can tell PHP beforehand to set a certain value for
anything that you might encounter in php.ini, like short_open_tags .

If this does for you what you want, you only have to change the way you call
php-cgi instead of changing all the scripts.
Thanx, however, I was unaware that I was using php-cgi.exe as I have
been using what I thought was php.exe instead. Will have to see if
that has the same "-d" option, would save a lot of time and effort
were it to be so, thanx!

Phil

>
Hope that helps.
Good luck. (Migrations are always a pain.)

Regards,
Erwin Moller
Jan 29 '07 #3

"comp.lang. php" <ph************ **@gmail.comwro te in message
news:11******** *************@j 27g2000cwj.goog legroups.com...
|I installed WAMP5 on my WinXP box which works just fine on its own,
| and I found a practical way of handling my short-tag PHP script
| via .htaccess:
|
| php_flag short_open_tag on
|
| To ensure my literally hundreds of PHP scripts will all function
| within the WAMP5 architecture.
|
| However, there is a case of a series of installer scripts written in
| PHP that are not meant to be run except as CLI PHP that obviously will
| not benefit from .htaccess, furthermore, changing the CLI PHP scripts
| from short to long tags is very much not an option due to both the
| volume of scripts and code complexity as patterns of '<' . '?..' or
| "<" . "?.." or '<' . "?.." will exist within scripts alongside the
| dynamic generation of other PHP scripts by other CLI PHP scripts.

volume is not important, nor is the pattern complex. you will either look
for:

<?

or

<?=

i'd suggest making a script that recurses your directory structure that does
a regex replace on all the files where that pattern matches. i'd have made a
backup of all the files first, then after having done the replacements,
attempt to install it on a test computer and bang on its functionality until
you are satisfied everything is working properly.

this is where foresight would have come in handy...althoug h i usually don't
fuss to much about short-tagging as, like i have suggested, the fix is
painfully easy.

hth,

me
Jan 29 '07 #4


On Jan 29, 9:45 am, "Steve" <no....@example .comwrote:
"comp.lang. php" <phillip.s.pow. ..@gmail.comwro te in messagenews:11* *************** *****@j27g2000c wj.googlegroups .com...
|I installed WAMP5 on my WinXP box which works just fine on its own,
| and I found a practical way of handling my short-tag PHP script
| via .htaccess:
|
| php_flag short_open_tag on
|
| To ensure my literally hundreds of PHP scripts will all function
| within the WAMP5 architecture.
|
| However, there is a case of a series of installer scripts written in
| PHP that are not meant to be run except as CLI PHP that obviously will
| not benefit from .htaccess, furthermore, changing the CLI PHP scripts
| from short to long tags is very much not an option due to both the
| volume of scripts and code complexity as patterns of '<' . '?..' or
| "<" . "?.." or '<' . "?.." will exist within scripts alongside the
| dynamic generation of other PHP scripts by other CLI PHP scripts.

volume is not important, nor is the pattern complex. you will either look
for:

<?

or

<?=
[snip]

Um, bad news, that's not all you're going to find in these installer
scripts. You're also going to find lines like this:

$php .= '<' . "?\n echo 'hello world'; ?" . '>';

And

if (preg_match('/<' . '\?/', $php)) // DO STUFF WITH $php CONTAINING
PHP CODE

Don't say I didn't warn you [re: "simplicity "]

Jan 29 '07 #5
"comp.lang. php" <ph************ **@gmail.comwro te in message
news:11******** *************@j 27g2000cwj.goog legroups.com...
php_flag short_open_tag on
and
the business requirement of these scripts being fully
portable installer scripts
....is just something you can't have. A set of scripts relying on short open
tags is not *fully portable*.

Sorry if this doesn't help you, but I just wanted to point out the obvious
flaw in this situation.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi. net | rot13(xv***@bhg byrzcv.arg)
Jan 30 '07 #6

"Kimmo Laine" <sp**@outolempi .netwrote in message
news:dv******** ******@reader1. news.saunalahti .fi...
| "comp.lang. php" <ph************ **@gmail.comwro te in message
| news:11******** *************@j 27g2000cwj.goog legroups.com...
| php_flag short_open_tag on
|
| and
|
| the business requirement of these scripts being fully
| portable installer scripts
|
| ...is just something you can't have. A set of scripts relying on short
open
| tags is not *fully portable*.
|
| Sorry if this doesn't help you, but I just wanted to point out the obvious
| flaw in this situation.

and your obvious lack of reading comprehension skills. he was *describing*
the obvious and how to resolve the short tag problem. you also missed where
he said 'php_flag short_open_tag on' doesn't solve it on all servers...thus,
still not fully portable. if it were, then YES, it would be fully
portable...and it would be something he *COULD* have.

as it is, you only agree with the op that there is a problem. if you cannot
provide a solution, why waste everyone's time. 'captain, there's a hole in
the hull. yes scrub, there is.' a lot of good that does.

moron
Jan 30 '07 #7
On Jan 30, 5:56 am, "Kimmo Laine" <s...@outolempi .netwrote:
"comp.lang. php" <phillip.s.pow. ..@gmail.comwro te in message

news:11******** *************@j 27g2000cwj.goog legroups.com...
php_flag short_open_tag on

and
the business requirement of these scripts being fully
portable installer scripts

...is just something you can't have. A set of scripts relying on short open
tags is not *fully portable*.

Sorry if this doesn't help you, but I just wanted to point out the obvious
flaw in this situation.
That can easily be overcome by this:

php -d short_open_tag= on -q /path/to/your/file.php

Kiitos!
>
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpkhttp://outolempi.net/ahdistus/- Satunnaisesti päivittyvä nettisarjis
s...@outolempi. net | rot13(x...@bhgb yrzcv.arg)

Jan 31 '07 #8
DD


On 29 Jan 2007 06:02:30 -0800, "comp.lang. php"
<ph************ **@gmail.comwro te:
>I installed WAMP5 on my WinXP box which works just fine on its own,
and I found a practical way of handling my short-tag PHP script
via .htaccess:


I've installed wamp 5 1.6.6. on winXP
for a testserver for learning php/mysql

it appears to be running
from the icon

I know that PHP is because localhost pops a page but

I get:

MySQL version :MySQL not launched or bad phpmyadmin config

Also:
from http://localhost/phpmyadmin/ i get a page with this error:

Welcome to phpMyAdmin 2.9.0.3

Error
MySQL said:

#2003 - The server is not responding

Anybod know how to get his up

Feb 12 '07 #9

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

Similar topics

1
9942
by: Jason G. | last post by:
I have heard that you cannot use short tags and XML because of the opening line of an xml document... <?xml version="1.0"?> Consider this: <<?= '?'; ?>xml version="1.0"<?= '?'; ?>> Problem Solved.
7
7110
by: varois83 | last post by:
Hi I am fairly new to PHP/mysql and was reading an online tutorial and learned that my short tags weren't enabled. At this time I have no need for them, my setup apache/mysql/php runs on my PC just to test code. Shall I enable short tags or not? Windows XP pro PHP 4
1
2405
by: Hans Gruber | last post by:
Hi all, Here`s a problem I have been working on for a while, but can`t seem to solve satisfactory. I have a database with blog entries. Because each of those entries has a variable length which can be quite long, I want to build an overview page. Of each entry there will be a preview version, say 700 characters max. My problem has to do with HTML tags. If for example an entry contains a
2
1541
by: nospam | last post by:
I'm trying to do a transform on some xml using the XslTransform class. The input xml contains an empty element in short format like this... <element attrib="abc"/> But during the transform it's being converted to the longer form like this... <element attrib="abc"></element>
7
2754
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
2
4209
by: varois83 | last post by:
Hi I am just starting with PHP. I am reading a PHP 5 book and they say to not use short tags and to actually disable them so I see an error message if I don't form my tags correctly. "short_open_tag" is currently set to "on", shall I set it to "off"? I am not planning on using short tags. Thanks a lot
4
3174
by: Christophe Charron | last post by:
Hi, is there a known bug on php 5.2.4 in wamp5 (http://www.wampserver.com/ en/index.php) about having different kinds of printing for some numeric values. This script works perfectly on an linux based server on internet but doesn't on my local wamp5. (here is the screnshot) http://test03.christophe-charron.org/public/php/2007_09_20/2007-09-22-qte_bizarre_b.png
4
3675
by: Sony89 | last post by:
Hi guys. How can you enable short tags in your browser?
18
6156
by: jessy | last post by:
Hi Guys, Just installed WAMP5 and placed my project in the WWW folder but whenever i access my project folder it shows me a blank page although my project folder got an index file . i don't know what's wrong !! ANy Help
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.