Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 26 Oct 2014, 00:08
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
php speed test not working: missing library
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Wed 10 Sep 2014, 20:59    Post_subject:  php speed test not working: missing library  

This is a script that calculates download speeds.

Code:
# php speedtest.php


php: error while loading shared libraries: libmcrypt.so.4: cannot open shared object file: No such file or directory

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Thu 11 Sep 2014, 06:12    Post_subject:  

A reference Rolling Eyes would've been nice. Anything else wrong?

Other than that, your item's in the repo and may require a symlink to function properly.

_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Thu 11 Sep 2014, 19:43    Post_subject:  

php is a program I installed using package manager.

I do not understand why it so many other programs listed in package manage don't come with all required libraries and other necessary items.

And a search for the missing library did not yield a Puppy version.

And view files in PM is not working anymore.
It used to open a text file.

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Fri 12 Sep 2014, 08:35    Post_subject:  

Missing lib, Pup version? Not sure what you meant there..

I don't necessarily grasp the next bit either. Are you hinting that Pups pkg mngr's broken?

What could I do to help you?

_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Fri 12 Sep 2014, 13:36    Post_subject:  

See my sig for Pup version. Smile

Puppy packager manager works, but I can't view missing libraries like I used to.

For example, I install a program and it has missing libraries.

There is a button (VIEW FILES) that shows missing libraries by opening up a text program with the missing libraries.

Clicking on it no longer does anything.

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Fri 12 Sep 2014, 15:26    Post_subject:  

Does it update?

Is there anything in /initrd/pup_ro2/usr/local/petget that isn't in /usr/local/petget?

I think maybe all this attribute fiddling has caught up with you.

Let's see your permissions:
Code:
ls -l /usr/local/petget

_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Fri 12 Sep 2014, 17:23    Post_subject:  

Code:

-rwxr-xr-x 1 root root 31273 Aug 12  2013 0setup
-rwxr-xr-x 1 root root   470 Aug 12  2013 ArchRunDotInstalls
-rw-r--r-- 1 root root 23409 Feb 10  2013 categories.dat
-rwxr-xr-x 1 root root 12117 Aug  4  2013 check_deps.sh
-rwxr-xr-x 1 root root  7891 Aug 12  2013 configure.sh
-rwxr-xr-x 1 root root 42848 Aug 12  2013 debdb2pupdb
-rwxr-xr-x 1 root root 12624 Aug  4  2013 dependencies.sh
-rwxr-xr-x 1 root root 22643 Aug  4  2013 downloadpkgs.sh
-rwxr-xr-x 1 root root  4575 Aug  4  2013 fetchinfo.sh
-rwxrwxrwx 1 root root 11340 Aug  4  2013 filterpkgs.sh
-rwxr-xr-x 1 root root 46816 Aug 12  2013 find_cat
-rwxr-xr-x 1 root root  7485 Aug  4  2013 findmissingpkgs.sh
-rwxr-xr-x 1 root root 12411 Aug  4  2013 findnames.sh
-rwxr-xr-x 1 root root  1783 Aug  4  2013 finduserinstalledpkgs.sh
-rwxr-xr-x 1 root root  5876 Aug  4  2013 hacks-postinstall.sh
-rw-r--r-- 1 root root  9727 Aug  4  2013 help-fr.htm
-rw-r--r-- 1 root root  9381 Aug  4  2013 help.htm
-rwxr-xr-x 1 root root 32994 Aug  4  2013 installpkg.sh
-rwxr-xr-x 1 root root 23551 Aug  4  2013 installpreview.sh
-rwxr-xr-x 1 root root  6808 Aug 12  2013 mageia2ppm
-rwxrwxrwx 1 root root 13538 Aug  4  2013 petget
-rwxrwxrwx 1 root root 22860 Aug 12  2013 pkg_chooser.sh
-rwxr-xr-x 1 root root  3408 Aug  4  2013 postfilterpkgs.sh
-rw-r--r-- 1 root root 10535 Aug  4  2013 README-add-repo.htm
-rw-r--r-- 1 root root   609 Aug  4  2013 README.txt
-rwxr-xr-x 1 root root  9849 Aug  4  2013 removepreview.sh
-rwxr-xr-x 1 root root  3833 Aug 12  2013 rpm2ppm
-rwxr-xr-x 1 root root  6582 Aug  4  2013 service_pack.sh
-rwxr-xr-x 1 root root  2197 Aug  4  2013 show_installed_version_diffs.sh
-rwxr-xr-x 1 root root  1045 Aug  4  2013 testurls.sh
-rwxr-xr-x 1 root root  7354 Aug  4  2013 ui_Classic
-rwxr-xr-x 1 root root  8950 Aug  4  2013 ui_Ziggy
-rwxr-xr-x 1 root root  2163 Aug  4  2013 verifypkg.sh


/initrd/pup_ro2/usr/local/petget does NOT exist.

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Fri 12 Sep 2014, 17:38    Post_subject:  

Those check out and libmcrypt's in a *functioning* PPM. What about my other question?
_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Fri 12 Sep 2014, 19:47    Post_subject:  

I can't compare 2 directories when I only have one.

Code:
/initrd/pup_ro2/usr/local/petget does NOT exist.[/quote]

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Fri 12 Sep 2014, 19:53    Post_subject:  

That directory's found on a *frugal* install. Since that's NOT what we're addressing, does PPM update?

No? Would you like a copy of that missing lib?

_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Sat 13 Sep 2014, 19:59    Post_subject:  

If by PPM update you mean does it update it's database, then yes it does does that.

Yes, thanks for the missing lib.

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Sat 13 Sep 2014, 20:18    Post_subject:  

That's good because it's important for pacman to function.

Now before the lib, search PPM for libmcrypt.. it should show.

As for what else may be missing from php, run: ldd /usr/bin/php

If it's somewhere else, use >> which php or find / -name php

If you can't get those to work, look here.

_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Mon 15 Sep 2014, 22:49    Post_subject:  

libmcrypt 2.5.8 is installed.

# ldd /usr/bin/php
linux-gate.so.1 (0xffffe000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb76e6000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb76cd000)
libmcrypt.so.4 => /usr/lib/libmcrypt.so.4 (0xb76a1000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0xb7696000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb75af000)
libm.so.6 => /lib/libm.so.6 (0xb7583000)
libpcre.so.0 => /usr/lib/libpcre.so.0 (0xb7546000)
librt.so.1 => /lib/librt.so.1 (0xb753d000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7522000)
libz.so.1 => /lib/libz.so.1 (0xb750b000)
libssl.so.1 => /lib/libssl.so.1 (0xb74a8000)
libcrypto.so.1 => /lib/libcrypto.so.1 (0xb72f1000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb71a3000)
libdl.so.2 => /lib/libdl.so.2 (0xb719e000)
liblzma.so.5 => /lib/liblzma.so.5 (0xb7179000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb715e000)
libc.so.6 => /lib/libc.so.6 (0xb6fd9000)
/lib/ld-linux.so.2 (0xb771a000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6fbc000)

What is this showing me ?

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 3972
Location: World_Hub

PostPosted: Tue 16 Sep 2014, 06:08    Post_subject:  

Confused Does the script run? Confirm it's the one from the page I posted earlier.
_________________
>>>Punctuation Crash Course<<<
Back to top
View user's profile Send_private_message 
fixit


Joined: 16 Mar 2013
Posts: 721
Location: El Lago, Texas

PostPosted: Tue 16 Sep 2014, 11:00    Post_subject:  

I can't find any script you posted, only some command line items.

Running this php script, yields the messages at the end of this message.

Code:
#!/usr/bin/php5
<?php
/*
 *  Speedtest.net linux terminal client.
 *  This is free and open source software by Alex based on a script from Janhouse
 *  Script uses curl, executes ifconfig commands in shell and writes temporary files in temp_down folder. Make sure you have everything set up before using it.
 */
header("content-type: text/plain");
/* * *              Configuration                   * * */
$iface="eth0";
$maxrounds=4;
$downloads="temp_down/";
$uploads="upload/";
$datadir="data/";
/* * *              Speedtest servers               * * */
$do_server['seattle'] = "http://speedtest.rainierconnect.com";
$do_server['east oregon'] = "http://speedtest.eotnet.net";
$do_server['portland'] = "http://speed.opusnet.com";
$do_server['estacada,or'] = "http://speed.rconnects.com/";

/* Variables */
$randoms=rand(100000000000, 9999999999999);
$time=time();
$day=date("d-m-Y");
$do_size[1]=500;
$do_size[2]=1000;
$do_size[3]=1500;
$do_size[4]=2000;
$do_size[5]=2500;
$do_size[6]=3000;
$do_size[7]=3500;
$do_size[8]=4000;

/* * *              The rest                        * * */
function latency($round){
    global $server, $downloads, $do_server, $server, $iface, $randoms, $do_size,$globallatency,$maxrounds;

    $file=$downloads."latency.txt";
    $fp = fopen ($file, 'w+');
    $ch = curl_init($do_server[$server]."/speedtest/latency.txt?x=".$randoms);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 50);
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

    $starttime=microtime(true);
    $response=curl_exec($ch);
    $endtme=microtime(true);

    $duration=$endtme-$starttime;

    curl_close($ch);
    fclose($fp);
    unlink($file);

    print round($duration, 2)."sec.";

    $globallatency+=$duration;
    if ($round > 1){
        latency(--$round);
    } else {
        print "\tAverage:".round($globallatency/$maxrounds, 2)."sec.\n";
    }
}

function download($size,$round){
    global $server, $downloads, $do_server, $server, $iface, $randoms, $do_size,$globaldownloadspeed,$maxrounds;

    $file=$downloads."fails_".$size.".jpg";

    print ".";
    $fp = fopen ($file, 'w+');
    $ln = $do_server[$server]."/speedtest/random".$do_size[$size]."x".$do_size[$size].".jpg?x=".$randoms."-".$size;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$ln);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 50);
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

    $starttime=microtime(true);
    $sakuma_rx=shell_exec("sudo ifconfig ".$iface."|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2");
    $response=curl_exec($ch);
    $beigu_rx=shell_exec("sudo ifconfig ".$iface."|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2");
    $endtme=microtime(true);

    if ($response === false){
       print "Request failed:".curl_error($ch);
    }
    curl_close($ch);
    fclose($fp);

    #unlink($file);

    $duration=$endtme-$starttime;

    if($duration<4 && $size!=8) {
        download(++$size,$round);
    }else{
        $sakuma_rx=trim($sakuma_rx);
        $beigu_rx=trim($beigu_rx);
        $rx=$beigu_rx-$sakuma_rx;
        $rx_speed=((($rx*8)/1000)/1000)/$duration;
        write_to_file(round($rx_speed, 2), "d");
        if($duration<4){
          print "Duration is ".round($duration, 2)."sec - this may introduce errors.\n";
        }
        print round(filesize($file)/1000000,2)."Mb at ".round($rx_speed, 2)."Mb/s";
        $globaldownloadspeed+=$rx_speed;
        if ($round > 1){
           download($size,--$round);
        } else {
           print "\tAverage: ".round($globaldownloadspeed/$maxrounds, 2)." Mb/s.\n";
  }
    }
}

function upload($size,$round){
    global $server, $uploads, $do_server, $server, $iface, $randoms,$globaluploadspeed,$maxrounds;

    $file=$uploads."upload_".$size;

    print ".";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_VERBOSE, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
    curl_setopt($ch, CURLOPT_URL, $do_server[$server]."/speedtest/upload.php?x=0.".$randoms);
    curl_setopt($ch, CURLOPT_POST, true);
    $post = array(
        "file_box"=>"@".$file,
    );
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

    $starttime=microtime(true);
    $sakuma_tx=shell_exec("sudo ifconfig ".$iface."|grep TX\ bytes|awk '{print $6}'|cut -d: -f2");
    $response = curl_exec($ch);
    $beigu_tx=shell_exec("sudo ifconfig ".$iface."|grep TX\ bytes|awk '{print $6}'|cut -d: -f2");
    $endtme=microtime(true);

    if ($response === false){
       print "Request failed:".curl_error($ch);
    }
    $aiznem=substr($response, 5);
    $kopa=filesize($file)+$aiznem;

    $duration=$endtme-$starttime; // sekundes

    if($duration<4 && $size!=8){
        #print round(filesize($file)/1000000,2)."Mb is to small: ".round($duration, 2)."sec\n";
        upload(++$size,$round);
    }else{
        $sakuma_tx=trim($sakuma_tx);
        $beigu_tx=trim($beigu_tx);
        $tx=$beigu_tx-$sakuma_tx;
        $tx_speed=((($tx*8)/1000)/1000)/$duration;
        write_to_file(round($tx_speed, 2), "u");
        if($duration<4){
          print "Duration is ".round($duration, 2)."sec - this may introduce errors.\n";
        }
        print round(filesize($file)/1000000,2)."Mb at ".round($tx_speed, 2)."Mb/s";
        $globaluploadspeed+=$tx_speed;
        if ($round > 1){
           upload($size,--$round);
        } else {
           print "\tAverage: ".round($globaluploadspeed/$maxrounds, 2)." Mb/s.\n";
  }
    }
}

function write_to_file($data, $updown){ // u - upload; d - download
    global $day, $time, $datadir, $iface;
    $fp = fopen($datadir."data_".$day.".txt", "a");
    fwrite($fp, $time."|".$updown."|".$iface."|".$data."\n");
    fclose($fp);
}

foreach ($do_server as $server => $serverurl){
  $globallatency=0;
  print "* Testing latency for $server...";
  latency($maxrounds);
}
foreach ($do_server as $server => $serverurl){
  $globaldownloadspeed=0;
  print "* Testing download speed for $server...";
  download(1,$maxrounds);
}
foreach ($do_server as $server => $serverurl){
  $globaluploadspeed=0;
  print "* Testing upload speed $server...";
  upload(1,$maxrounds);
}


?>

# php speedtest.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/dba.so' - libdb-4.8.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/gd.so' - libt1.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/intl.so' - libicui18n.so.49: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/snmp.so' - libnetsnmp.so.25: cannot open shared object file: No such file or directory in Unknown on line 0
Could not open input file: speedtest.php
#

_________________
Andy

Primary O.S. Slacko Puppy 5.6.0
Secondary Slacko Puppy 5.7.0
Tertiary Windows XP SP3
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1294s ][ Queries: 12 (0.0276s) ][ GZIP on ]