# Unable to access php.ini

**URL:** https://forum.infinityfree.com/t/unable-to-access-php-ini/31201
**Category:** Hosting Support
**Created:** [June 6, 2020, 1:25pm UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201 "2020-06-06T13:25:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 6, 2020, 1:25pm UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/1 "2020-06-06T13:25:54Z")

</div>

Hey,  
I am unable to find the php.ini file on my domain. Also I’m unable to upload file on a directory using a php script.

---

<div class="post-metadata">

### Author: ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)
#### Post date: [June 6, 2020, 1:27pm UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/2 "2020-06-06T13:27:47Z")

</div>

You cannot alter php.ini in this hosting.

About files explain more about it.

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:31am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/3 "2020-06-08T07:31:05Z")

</div>

So how can I upload file:  
I am using the following php script:

```auto
<?php
   if(isset($_FILES['image'])){
      $errors= array();
      $file_name = $_FILES['image']['name'];
      $file_size = $_FILES['image']['size'];
      $file_tmp = $_FILES['image']['tmp_name'];
      $file_type = $_FILES['image']['type'];
      $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
      
      $extensions= array("jpeg","jpg","png");
      
      if(in_array($file_ext,$extensions)=== false){
         $errors[]="extension not allowed, please choose a JPEG or PNG file.";
      }
      
      if($file_size > 2097152) {
         $errors[]='File size must be excately 2 MB';
      }
      
      if(empty($errors)==true) {
         move_uploaded_file($file_tmp,"/htdocs/".$file_name);
         echo "Success";
      }else{
         print_r($errors);
      }
   }
?>
<html>
   <body>
      
      <form action = "" method = "POST" enctype = "multipart/form-data">
         <input type = "file" name = "image" />
         <input type = "submit"/>
			
         <ul>
            <li>Sent file: <?php echo $_FILES['image']['name']; ?>
            <li>File size: <?php echo $_FILES['image']['size']; ?>
            <li>File type: <?php echo $_FILES['image']['type'] ?>
         </ul>
			
      </form>
      
   </body>
</html>

```

---

<div class="post-metadata">

### Author: ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)
#### Post date: [June 8, 2020, 7:32am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/4 "2020-06-08T07:32:19Z")

</div>

Any errors?

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:34am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/5 "2020-06-08T07:34:15Z")

</div>

no

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:35am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/6 "2020-06-08T07:35:11Z")

</div>

The script says the file uploaded but when i go and check I always find that theres no file uploaded

---

<div class="post-metadata">

### Author: ![katufo](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/katufo/32/7659_2.png) [@katufo](https://forum.infinityfree.com/u/katufo)
#### Post date: [June 8, 2020, 7:36am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/7 "2020-06-08T07:36:38Z")

</div>

Maybe because of your CHMOD or permission? Make it wri-writable in public.

Locate the folder where you want to upload the pictures then change the permission to 777.

---

<div class="post-metadata">

### Author: ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)
#### Post date: [June 8, 2020, 7:42am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/8 "2020-06-08T07:42:53Z")

</div>

> [@anon53135199](#):
>
> move\_uploaded\_file($file\_tmp,“/htdocs/”.$file\_name);

should be:

```auto
move_uploaded_file($file_tmp, __DIR__."/htdocs/".$file_name);

```

I’ve forgotten php a bit, you might `var_dump( __DIR__ );`  
if it has htdocs at end, you should use this:

```auto
move_uploaded_file($file_tmp, __DIR__.$file_name);

```

* * *

**REMEMBER** this is a hosting for hosting _websites_, not _pictures_.

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:49am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/9 "2020-06-08T07:49:54Z")

</div>

Does’nt really works. By the way, thank you so much for giving your time.

---

<div class="post-metadata">

### Author: ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)
#### Post date: [June 8, 2020, 7:50am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/10 "2020-06-08T07:50:46Z")

</div>

> [@anon19508339](#):
>
> `var_dump( __DIR__ );`

???

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:53am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/11 "2020-06-08T07:53:54Z")

</div>

Hey can I make my own php.ini file and then can I upload it.  
Will it work?

---

<div class="post-metadata">

### Author: ![UnknownLolz](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/unknownlolz/32/14581_2.png) [@UnknownLolz](https://forum.infinityfree.com/u/UnknownLolz)
#### Post date: [June 8, 2020, 7:56am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/12 "2020-06-08T07:56:03Z")

</div>

Nope that’s not gonna work

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:57am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/13 "2020-06-08T07:57:17Z")

</div>

Thanks for letting me know about it. But what else can I do

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 7:59am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/14 "2020-06-08T07:59:53Z")

</div>

Sorry to tell you but the same thing happens the script says the file has been uploaded but when I go and check it i found nothing.  
Here are the screen shots.

 ![Screenshot_14](https://forum-cdn.infinityfree.net/original/2X/1/124bfee4051b0df3a62648ff2b9ab089acf45619.png)

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 8:01am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/15 "2020-06-08T08:01:01Z")

</div>

![Screenshot_13](https://forum-cdn.infinityfree.net/original/2X/d/d7d65a19b4df82833c515fb754f9908be4dbb7e9.png)

---

<div class="post-metadata">

### Author: ![katufo](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/katufo/32/7659_2.png) [@katufo](https://forum.infinityfree.com/u/katufo)
#### Post date: [June 8, 2020, 8:01am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/16 "2020-06-08T08:01:43Z")

</div>

> [@katufo](#):
>
> Locate the folder where you want to upload the pictures then change the permission to 777.

Have you tried this one? Make it writable in public.

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 8:02am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/17 "2020-06-08T08:02:19Z")

</div>

Done. But nothing happens.

---

<div class="post-metadata">

### Author: ![katufo](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/katufo/32/7659_2.png) [@katufo](https://forum.infinityfree.com/u/katufo)
#### Post date: [June 8, 2020, 8:06am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/18 "2020-06-08T08:06:52Z")

</div>

Its your php code problem maybe. Try to run the php code with the html first on your pc use xamp for that, and if the problem still occur in your pc, then its your php code problem, not infinityfree server problem.

---

<div class="post-metadata">

### Author: ![anon53135199](https://forum.infinityfree.com/letter_avatar/anon53135199/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon53135199](https://forum.infinityfree.com/u/anon53135199)
#### Post date: [June 8, 2020, 8:12am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/19 "2020-06-08T08:12:08Z")

</div>

Hey can you please tell me that  
Does Infinity really allow free users to upload file using a php script.  
And have you ever tried to upload a file using php script on free account.

---

<div class="post-metadata">

### Author: ![JavesPotato](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/javespotato/32/53167_2.png) [@JavesPotato](https://forum.infinityfree.com/u/JavesPotato)
#### Post date: [June 8, 2020, 8:18am UTC](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201/20 "2020-06-08T08:18:49Z")

</div>

Hey there. InfinityFree allows you to upload files as long as:

1. The file is acceptable. The file is not a prohibited file. The file is safe.
2. Not exceed to 10MB file upload limit.

For me, I already tried to upload using php. It is working. I even have my own file manager written on PHP.

[Next page](https://forum.infinityfree.com/t/unable-to-access-php-ini/31201.md?page=2)
