librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.09k stars 2.18k forks source link

Unable to get IP address and download test seems slow #147

Closed davboroyal closed 6 years ago

davboroyal commented 6 years ago

I get this from the getip.php page: Parse error: parse error, expecting `')'' in E:\web\htdocs\supportweb\speedtest-master\getIP.php on line 22

And download seems really slow ... less than a Meg versus 93 Meg Upload from my testing which I would expect ...

I'm running the code on an older windows 2008 box with Apache/PHP Apache/2.2.11 (Win32) mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9-1

Any places to start .. you mentioned a garbage.dat file, I downloaded, but not quite sure how to reference, etc .. image

adolfintel commented 6 years ago

It looks like you have some config issue with PHP. If you give me the URL of your server I can take a look.

davboroyal commented 6 years ago

Sadly it's an internal server. Can't get access to you ...

adolfintel commented 6 years ago

Ok, I'll try to help you anyway. Try to connect to http://yourserver/garbage.php, does it start a download? If it does, is it a large file or just a few bytes?

davboroyal commented 6 years ago

It downloaded a 1K file

davboroyal commented 6 years ago

random.dat

adolfintel commented 6 years ago

Open it in notepad, there's probably a server error inside

davboroyal commented 6 years ago


Fatal error: Call to undefined function openssl_random_pseudo_bytes() in E:\web\htdocs\supportweb\speedtest-master\garbage.php on line 18

adolfintel commented 6 years ago

Looks like the OpenSSL module isn't configured correctly in PHP

davboroyal commented 6 years ago

Ughh ... seems to be, but not sure what to check ... it's in the php.ini and enabled.

adolfintel commented 6 years ago

Try reinstalling the module, maybe it will fix it

davboroyal commented 6 years ago

Would this affect the GETIP.php as well ?

adolfintel commented 6 years ago

getIP doesn't use OpenSSL, there must be another problem with that. Line 22 doesn't contain any syntax error, unless you modified it.

davboroyal commented 6 years ago

Well it's there and working, perhaps an older version .. is there a way to not use the openssl ... and just use the file download for speedtest ?

adolfintel commented 6 years ago

Yes, you can use a large file instead of garbage.php, it's explained in the documentation. See the url_dl parameter

On August 8, 2018 7:10:12 PM GMT+02:00, davboroyal notifications@github.com wrote:

Well it's there and working, perhaps an older version .. is there a way to not use the openssl ... and just use the file download for speedtest ?

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: https://github.com/adolfintel/speedtest/issues/147#issuecomment-411481515

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

davboroyal commented 6 years ago

Nope, didn't modify the line ... I was also looking at the url_dl parameter and where do I edit to put the location of the file as opposed to the garbage.php ?

adolfintel commented 6 years ago

In your HTML file look for the line that says w.postMessage('start') and replace 'start' with 'start {"url_dl":"garbage.dat"}'. More about this here: https://github.com/adolfintel/speedtest/wiki/Changing-the-test-settings

davboroyal commented 6 years ago

Found it just before you posted .. edited and it worked.. thanks .. Now just need to get the getip.php working .. not sure why .. looks fine where it's complaining.

adolfintel commented 6 years ago

Maybe the PHP version is too old? The oldest one I tried was 5.3

On August 8, 2018 7:31:44 PM GMT+02:00, davboroyal notifications@github.com wrote:

Found it just before you posted .. edited and it worked.. thanks .. Now just need to get the getip.php working .. not sure why .. looks fine where it's complaining.

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: https://github.com/adolfintel/speedtest/issues/147#issuecomment-411488329

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

adolfintel commented 6 years ago

Yes, I just checked again and 5.4 seems to be the oldest version that can run getIP. 5.3 and older give your same syntax error because that syntax for arrays was added in 5.4 (http://php.net/manual/en/migration54.new-features.php) I'll update the documentation.

davboroyal commented 6 years ago

Ok, I’ll find another option for that ... Thanks for your help.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Federico Dossena notifications@github.com Sent: Wednesday, August 8, 2018 3:04:12 PM To: adolfintel/speedtest Cc: davboroyal; Author Subject: Re: [adolfintel/speedtest] Unable to get IP address and download test seems slow (#147)

Yes, I just checked again and 5.4 seems to be the oldest version that can run getIP. 5.3 gives me a syntax error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/adolfintel/speedtest/issues/147#issuecomment-411498522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AoQaxtNoVi9jnJkM6dVXUqRqEzMjxZfgks5uOygcgaJpZM4V0CDI.

dtech4you commented 6 years ago

so i am having somewhat same problem but not sure why. so i have 2 servers i am testing on both linux both running same setups the only diffrence being that one is local without a domain and the other is external with a domain. the web-server running it is ngnix not apache2. so the problem is the local server works like one would hope, but the external server is having problems talking to the php files which i am not sure why and or how my only guess is has something to do with the letsecrypt domain name sky.quickbox.io/speedtest

https://vgy.me/RFjRlk.png

any help in getting this working would more than likely result in donations down the road.

adolfintel commented 6 years ago

@dtech4you It looks like a problem with the web server configuration. I'm not quite sure what exactly because I never used nginx

dtech4you commented 6 years ago

figured out the problem but not the solution and not sure if it has to do with how nginx is but it is broke due to the domain name not sure if its not understanding the uri or what wondering how might go about this as tried with same setup on a external server without letsencrypt and works just fine