0

I have a problem that I can't seem to fix. I would really appriciate any help!

I am trying to make a script to upload files using the function move_uploaded_file, and it dosent work.

So I tried to change php.ini but theses changes dosent reflect in phpinfo()???

I am using Ubuntu with Lampp php8, but I am quite new to linux

  • I have restarted the computer

  • I am using the php.ini which is defined in phpinfo "Loaded configuration file"

  • I have set php.ini permission to 777

  • There is no .htaccess

  • I don't have PHP-FPM installed or Nginx

  • There is no other php.ini in the lampp directory

  • Read somewhere that in PHP8 doesn't allow changes so you need to make a new php.ini, and in the php ini it says: "Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" ;user_ini.filename = ".user.ini"

  • BUT when I touch .user.ini in terminal, nothing gets created.

enter image description here

Any ninjas out there, that can help me?

Dylan KAS
  • 4,840
  • 2
  • 15
  • 33
  • Hey Glen, _it dosen't work_ is not a very helpful problem description. Would you mind sharing what exactly doesn't work (any error messages)? Please read [ask]. – berend Nov 24 '21 at 09:00
  • Check [this answer](https://stackoverflow.com/a/49908572/9074272). – ciekals11 Nov 24 '21 at 09:05
  • Hi. I was so obsessed with the php.ini that i forgot to write about this.. So I´m testing this script at my hosting provider instead of my local lampp server.... Here is the link to phpinfo: https://basisit.dk/test/index.php the function move_uploaded_file returns FALSE. nothing gets moved You can test and see vardump here: https://basisit.dk/test/file_upload.php Further more the – Glen Rose Nov 24 '21 at 09:45
  • `I restarted the computer`. Do you mean the server by that? If not, restart Apache, it will only load the new php.ini after that. – Merijndk Nov 24 '21 at 09:55
  • It means I restarted the computer completely. So I was sure everything was restarted including the apache – Glen Rose Nov 24 '21 at 10:34
  • Status is that I got the file upload to work. I needed to move $_FILES['file']['tmp_name'] (Thanks to great support at simply.com) BUT i still cant change my php.ini settings – Glen Rose Nov 24 '21 at 12:26
  • If you change the configuration on any other server than your local computer, you can restart your own computer as often as you like - you need to restart the Apache process on your remote webserver – Nico Haase Nov 25 '21 at 15:39
  • Also, what do you mean by "it doesnt work"? You haven't shared any PHP code, nor any error message – Nico Haase Nov 25 '21 at 15:39

0 Answers0