Server side script problem - WeOnlyDo Discussion board

Server side script problem (wodWebServer / wodWebServer.NET)

by Jose, Wednesday, September 08, 2004, 20:01 (7172 days ago)

Hello,

when I have an error on a CGI script, the component just delete the file or change the content. for instance create a page with content <?php_info()?> and save it on the document root of the wodWebserver as test.php

Call that page and execute it using User.Response.CGI and the paramaters of your php installation.

The page will be or deleted or the content will be changed by the response.

bug ?
Thanks
Jose

Re: Server side script problem

by wodSupport, Wednesday, September 08, 2004, 20:04 (7172 days ago) @ Jose

Jose,

yes - this makes sense. I think it's a feature - but rather BAD one, right?

Ok, let's fix it. Can you send me some code you use so I can duplicate your problem, and fix it fast? You can send it to techsupport@weonlydo.com

Thanks.

Re: Server side script problem

by Jose, Wednesday, September 08, 2004, 20:46 (7172 days ago) @ wodSupport

Hi thanks, that was quick!

to reproduce the problem is simple. If you have php installed, use the sample for php in the vb samples directory and change the content of hello.php or add a new php file with a script error.

Option Explicit
Dim WithEvents Http1 As wodWebServerCom

Private Sub Form_Load()
Set Http1 = New wodWebServerCom

'On Error Resume Next
Http1.Port = 881
Http1.Start
Http1.DocumentRoot = App.Path
If Err Then
MsgBox There was an error: & Err.Description, vbOKOnly, Error
End If
'ShellExecute vbNull, open , http://localhost:881/phpinfo.php , , , 0
End Sub

Private Sub Http1_CGIStart(ByVal User As WODWEBSERVERCOMLib.IWebUser, ByVal FullPath As String, ByVal Environment As WODWEBSERVERCOMLib.IWebHeaders)
Environment.Add REDIRECT_STATUS , 200
Debug.Print Environment.ToString
End Sub

Private Sub Http1_RequestDone(ByVal User As WODWEBSERVERCOMLib.IWebUser)
User.Response.CGIExecute D:phpphp.exe & User.Request.PageName
User.Response.StatusCode = 200
End Sub

et voila !
Thanks
Jose

Re: Server side script problem

by wodSupport, Wednesday, September 08, 2004, 21:56 (7172 days ago) @ Jose

Jose,

hmm, I am unable to duplicate this. I changed phpinfo.php to this (obviously wrong:)

[code]<?php

blah
phpinfo();
?>[/code]

Error is returned from wodWebServer to client's browser, but phpinfo.php remains intact.

Do you have the most recent version of wodWebServer? What else could be different in your tests?

Kreso

Re: Server side script problem

by Jose, Thursday, September 09, 2004, 10:42 (7172 days ago) @ wodSupport

Hello,

yes wodWebD.dll is 1.0.0.7 . Could It happen only on debug mode ?
I have just done it again with your code on the php file and the content of my file is now <br>
<b>Parse error</b>: parse error in <b>D:DEVJOSEVBWEB est.php</b> on line <b>4</b><br>

Thanks

Jose

Re: Server side script problem

by perezjos, Friday, September 10, 2004, 15:24 (7171 days ago) @ Jose

Hi Kreso,

do you have anything new ? It is really a problem when you develop a web interface to an app.
For instance my index.html page contains include to css file and javascript

....
<link rel= STYLESHEET type= text/css href= css/Outlook.CSS >
<script language= JScript src= Library/JavaScript/Calendar.js ></script>
...

so if calendar.js file does not exist or is not found, the content of the last page loaded in this case outlook.css is replace with error message.
[:uhoh:]

repeat that a couple of time in the page and you can see my nigthmare.

thanks

jose

Re: Server side script problem

by wodSupport, Friday, September 10, 2004, 20:56 (7170 days ago) @ perezjos

Jose,

sorry, somehow I missed your last post. I will try with code you specified and get back to you today.

Kreso

Re: Server side script problem

by wodSupport, Saturday, September 11, 2004, 00:28 (7170 days ago) @ wodSupport

I tried all I could think of - but I can't make it overwrite original PHP file.

Can you please change our sample so it demonstrates the problem, put it in, for example, C:\phptest folder, zip it and send it to me. Also, send me your PHP.INI file from WINDOWS folder. Tell me where to click, how to start, anything you can think of being important for the error. Perhaps that will help?

Please send it to techsupport@weonlydo.com

Thanks,
Kreso

Re: Server side script problem

by Jose, Monday, September 13, 2004, 02:22 (7168 days ago) @ wodSupport

Hello
This has nothing to do with php.

in order to reproduce please follow the instructions:

1- Create a directory called test.
2- Create a file on that directory called testpage.htm
3- Cut and paste this content

<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN >
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<BODY>
<img src= /Idonotexist.jpg />
</BODY>
</HTML>

4- Open vb add a form and a reference to wodWebD.dll
5- Add the following code to the form

Option Explicit
Dim WithEvents Http1 As wodWebServerCom
Private Sub Form_Load()
Set Http1 = New wodWebServerCom
Set Http1 = New wodWebServerCom
Http1.Port = 89
Http1.DocumentRoot = C: est
On Error Resume Next
Http1.Start
End Sub

7- Start the program (F5)

6- Open Internet explorer and load the test page
http://localhost:89/testpage.htm

7- The browser should show the content of the page as you created it. No problem.
8- Press refresh a few times until you get the page

! Document not found.
The page you are trying to reach is currently unavailable.

9- At that stage your content has been modified with the error message if you are lucky!, otherwise the page testpage.htm has been deleted.

[:happy:] hoops !

Jose

Re: Server side script problem

by wodSupport, Monday, September 13, 2004, 05:07 (7168 days ago) @ Jose

Jose,

can you please contact me at techsupport email? I think this is fixed now, but I would like you to test updated version before we publish it. Can you please send me email so I can reply with fixed (I hope!) version?

Thanks,
Kreso