1

EDIT : the pbm is not that I used space in the password after all, so I changed the description

While trying to configure xampp, I ran into an error : fatal: unknown configuration directive 'function' on line 44 of '/opt/lampp/etc/proftpd.conf'

  1. first, I downloaded and installed xampp
  2. then, I ran the command sudo lampp restart and it worked
  3. third, I ran sudo lampp security, and I created some passwords
  4. I tried the command sudo lampp restart again, but this time i got the error message

the file in /opt/lampp/etc/proftpd.conf :

 40 # daemon gets the password "xampp"
 41 # commented out by xampp security
 42 #UserPassword daemon 2TgxE8g184G9c
 43 UserPassword daemon <?
 44     function make_seed() {
 45         list($usec, $sec) = explode(' ', microtime());
 46         return (float) $sec + ((float) $usec * 100000);
 47     }
 48     srand(make_seed());
 49     $random=rand();
 50     $chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
 51     $salt=substr($chars,$random % 64,1).substr($chars,($random/64)%64,1);
 52     $pass=$argv[1];
 53     $crypted = crypt($pass,$salt);
 54     echo $crypted."
 55 ";
 56 ?>

if I comment all these lines, xampp starts and I can go to the web page localhost/phpmyadmin/, and there I wanted to change my password for a new one without single quotes, but it says I'm not allowed :

 MySQL said: Documentation
#1131 - You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings

also, my password is in clear in this file /opt/lampp/phpmyadmin :

 38 /**
 39  * phpMyAdmin configuration storage settings.
 40  */
 41 
 42 /* User used to manipulate with storage */
 43 // $cfg['Servers'][$i]['controlhost'] = '';
 44 // $cfg['Servers'][$i]['controlport'] = '';
 45 $cfg['Servers'][$i]['controluser'] = 'pma';
 46 # commented out by xampp security
 47 #$cfg['Servers'][$i]['controlpass'] = '';
 48 $cfg['Servers'][$i]['controlpass'] = 'password_here';

I don't know how to solve that.

I tried uninstalling everything and start all over again, but it didn't fix it (I did it so i was certain of what I did).

hugogogo
  • 361
  • 2
  • 15
  • 1
    Try [resetting the password for PHPMyAdmin](https://askubuntu.com/questions/321903/resetting-forgotten-phpmyadmin-password), and read [this](https://stackoverflow.com/questions/16511444/how-to-get-back-lost-phpmyadmin-password-xampp) post to see why re-installing is not a good/nice answer – Luuk Aug 06 '21 at 06:52
  • i tried with your links, the process was succesfull (with minor issues easy to fix), but the pbm remains :/ i will reinstall anyway since i had created nothing yet :p – hugogogo Aug 06 '21 at 09:21
  • ok, i reinstalled, i tried to `sudo lampp restart`, everythiing was fine, then i ran `sudo lampp security`, i created the passwords as asked, and now i get the same error : `fatal: unknown configuration directive 'function' on line 44 of '/opt/lampp/etc/proftpd.conf'` :/ you were right that re-installing wasn't a solution ;) – hugogogo Aug 06 '21 at 09:35

2 Answers2

1

what you actualy did for sudo lampp security it just generating this below little boilerplate about hash and salt, that passed in $LAMP_DIR/etc/proftpd.conf

function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$random=rand();
$chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
$salt=substr($chars,$random % 64,1).substr($chars,($random/64)%64,1);
$pass=$argv[1];
$crypted = crypt($pass,$salt);
echo $crypted."
";

that's fine. just because your xampp php not compiled hash automaticaly to you, you can move for next step by adding php keyword after UserPassword $ftpuser <? kind like below:

UserPassword daemon <?php
        function make_seed() {
            list($usec, $sec) = explode(' ', microtime());

        #bla-bla-bla

dont forget in $pass=$argv[1]; just change with $pass="your password here";

then run them with your php interpreter /opt/lampp/bin/php /opt/lampp/etc/proftpd.conf

and viola

# daemon gets the password "xampp"
# commented out by xampp security
#UserPassword daemon 2TgxE8g184G9c
UserPassword daemon dAN1WkV7r2TsU

# daemon is no normal user so we have to allow users with no real shell
RequireValidShell off

# daemon may be in /etc/ftpusers so we also have to ignore this file
UseFtpUsers off
dev@enigma:/opt/lampp$ 

you've got your new passwd UserPassword $ftpuser dAN1WkV7r2TsU

or you can just assign plain password with UserPassword $ftpuser "plain_pw_here"

Sandiko
  • 11
  • 3
0

I changed the "proftpd.conf" file with the following code:

UserPassword daemon lampp
#UserPassword daemon <?
#   function make_seed() {
#       list($usec, $sec) = explode(' ', microtime());
#       return (float) $sec + ((float) $usec * 100000);
#   }
#   srand(make_seed());
#   $random=rand();
#   $chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
#   $salt=substr($chars,$random % 64,1).substr($chars,($random/64)%64,1);
#   $pass=$argv[1];
#   $crypted = crypt($pass,$salt);
#   echo $crypted."
#";
#?>
  • 1
    Please add some explanation to your answer such that others can learn from it. What did you change and why? – Nico Haase Jan 05 '22 at 16:04