View previous topic :: View next topic |
Author |
Message |
aalaap -
Joined: 30 Mar 2004 Posts: 3
|
Posted: Tue Mar 30, 2004 6:35 pm Post subject: Making PHP parse php scripts named .asp as well? |
|
|
There's an app that is completely in ASP but i want to rewrite it using PHP but keeping the filenames same .. so there is no change required except for the backend. I tried adding "asp asa" to the list of extensions of the php parser (in addition to "php") but in IE i only get a "page cannot be displayed" and firefox says "no input file specified". For testing the test.asp file contains:
Code: | <? echo "hello"; ?> |
How do I make it work?
For clarification: i dont want to run or use ASP - i want to write pure php but the filenames have to end in .asp for compatibility purposes.
- Aalaap |
|
Back to top |
|
 |
nquin321 -
Joined: 29 Jan 2004 Posts: 296 Location: Right Behind You
|
Posted: Tue Mar 30, 2004 7:56 pm Post subject: |
|
|
do this:
http://www.aprelium.com/abyssws/php.html
do this also
Enter asp in the Associated extensions, set Automatic Update of the CGI Paths (if available) to Yes, and press OK. |
|
Back to top |
|
 |
nquin321 -
Joined: 29 Jan 2004 Posts: 296 Location: Right Behind You
|
|
Back to top |
|
 |
aalaap -
Joined: 30 Mar 2004 Posts: 3
|
Posted: Wed Mar 31, 2004 9:16 pm Post subject: |
|
|
Like I said in my earlier post, I already tried to make PHP handle asp and asa files but it doesnt take them. Technically it shouldn't matter since it doesnt really care about the extension anyway .. the web server does. Adding asp/asa to the extensions list does nothing.
ASP2PHP is not what I need. I've almost finished rewriting the ASP code (with enhancements, bug fixes) into PHP, but its the URLs that are important .. since there are other applications accessing these scripts using the .asp extensions, i have to keep the filenames .asp.
- Aalaap |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Mar 31, 2004 9:17 pm Post subject: |
|
|
What is it exactly are you trying to do with
php files named .asp , PHP is for .php and
ASP is for .asp , thats just the way it is ! |
|
Back to top |
|
 |
aalaap -
Joined: 30 Mar 2004 Posts: 3
|
Posted: Wed Mar 31, 2004 9:26 pm Post subject: |
|
|
If you go to c:\php and run php.exe without any parameters, it says No input file specified, which is the exact same error that Firefox shows me. From what I infer, Abyss is not passing the filename.asp parameter when it runs php after http://localhost/filename.asp is called.
Now that is funny, since it DOES call php (the no input file error is a php.exe error), but wihtout the script filename.
Part one:
URL called: http://localhost/test.php
Abyss takes it, figures out that the file is .php so php.exe should run it, so calls: c:\php\php.exe \htdocs\test.php
php runs the script, spits out the 200 header and the file contents. and everyone lives happily .. till the next try.
Part two:
URL called: http://localhost/test.asp
Abyss takes it, figures out that its an asp and the handler is also php.exe in the settings here so it calls: c:\php\php.exe
thats it .. no script filename .. php runs .. cant find any input file so says "No input file specified" and quits. Notice the absence of the 404 header. IE interprets it as a server error and says "page cannot be displayed" but Firefox .. just takes all the output regardless of the header absence and displays it.
Could this be a bug in Abyss?
- Aalaap |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Mar 31, 2004 10:38 pm Post subject: |
|
|
ASP is a whole different language their is really no way to
make this work unless your a very good programmer in
PHP and ASP , I would just forget about it. LateR! |
|
Back to top |
|
 |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 01, 2004 1:10 am Post subject: |
|
|
Like TRUSTpunk said earlier, why are you trying to do this? _________________ Bienvenidos! |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Apr 02, 2004 4:07 pm Post subject: |
|
|
aalaap,
PHP is a special case of CGI interpreters since it is better to pass the script name in the environment rather than passing it in the command line. Abyss takes care of this when the extension is php.
To solve the problem, you can use our PHP wrapper (available from http://www.aprelium.com/data/phpwrap.zip). _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Fri Apr 02, 2004 11:55 pm Post subject: |
|
|
How many other programs do you have hidden in your data directory? _________________ Bienvenidos! |
|
Back to top |
 |
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Sat Apr 03, 2004 12:18 am Post subject: |
|
|
I don't think thats any of your business lol :D |
|
Back to top |
|
 |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Sat Apr 03, 2004 12:38 am Post subject: |
|
|
Yeah, that was meant as sort of a joke. I guess I'll have to start using emoticons so I can "set the mood" on my posts. _________________ Bienvenidos! |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Mon Apr 05, 2004 2:06 pm Post subject: |
|
|
iNaNimAtE wrote: | How many other programs do you have hidden in your data directory? |
PHPWrap isn't hidden :D It was written as a workaround fot the CGI PHP bug that users faced when PHP 4.3.3 was released. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
j_browne -
Joined: 26 Mar 2004 Posts: 13
|
Posted: Thu Apr 15, 2004 5:04 pm Post subject: it worked! |
|
|
aren't they clever?
now to find a use for this fix... :? |
|
Back to top |
|
 |
|