0
votes
 <?php
    include("/Crypt/RSA.php");
    $rsa = new Crypt_RSA();
     $token=base64_decode("iKmHdK3ChRBPAU/I/wTKld4up91TMrcWjkE+VGggVryRzvhKC6l+sZ3F+j+qyW8rxg01/uu2E3z6aVirwmQ0ig==");
     $private=base64_decode("MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAyUFH4OJOUOKh38raMxiQhmtuNSMxcznSdt9fWiJZOYpnv1rbu3h/heNCIOxOHSrlMz8FAKAW6rd9ddXNcm4myQIDAQABAkEApGbPcMVtdGWuFkJ/PH40kZnwzTeSja4OX0zZd6fXe0hBZZjA1nREuLGh2x7OXkpArytgQ35W2NHCxeldniTmgQIhAO7SB0Mhb/HLst4ty6HT2kZoAC/N2UdsBtQFdC8sNNxXAiEA17t4cVsx5EYYFifDSUwawz5pJSfrQYk1C0H1atL9Id8CIQDOtJL8k7BkxD5o95JM2yUN02518eGiY+n1EVNikQyfuQIgdph88fQsTU2rWCKr3NOVstfQfbigP/rpyjKMdBlhRwkCIE/x13OF2JUHlA5DqxCVh3LHMDDowr7SkQ2QVkqfBcAb");
    $rsa->loadKey($privateKey);
    echo $rsa->decrypt($cipher);
?>

i kept my include_path as .:/usr/local/lib/php

i am getting errors like this:

Warning: include(/Crypt/RSA.php) [function.include]: failed to open stream: No such file or directory in /home/futureti/public_html/reg2.php on line 2

Warning: include() [function.include]: Failed opening '/Crypt/RSA.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/futureti/public_html/reg2.php on line 2

Fatal error: Class 'Crypt_RSA' not found in /home/futureti/public_html/reg2.php on line 3

2
Remove the leading slash from your include statement, you're currently defining an absolute path from the root of the drive.Sammitch
Where did you install Crypt/RSA.php? Have you installed it?neubert
yes i installed from PEAR packages in Cpanel the directory structure is root folder under it php, public_html and other some folders for website. when I installed in php it created a directory Crypt in it RSA.php exists. In public_html the php script i want to run exists. And one more thing when I installed Crypt_RSA it was installed but at last it prompted an error like in bin folder phpize can't be created.user3481084

2 Answers

1
votes

Try this:

include('../Crypt/RSA.php');

Your current leading / is creating an absolute link, so going right back to your root directory.

../ means one folder up.

0
votes

Try using the document root variable:

$doc_root = $_SERVER['DOCUMENT_ROOT'];
include($doc_root . "/Crypt/RSA.php");