September 2, 2012

how to enable php on a subdomain?

Question by Link

when i’m using the

“www . website . com”

php codes are working but when i’m using it on a subdomain the php script won’t work

“secure . website . com”

how can i enable the use of php code on my subdomain?
i’m using justhost as my server.

my subdomain is located at
/public_html/secure <–folder directory

but when i put the files inside the folder,
php scripts won’t work.
how can i enable php scripts inside my folder?

<?php
phpinfo();
?>

says it’s not supported?

justhost said to contact a php developer regarding this issue that is just what i’m doing.

Answer by Starx

This looks to be because of the server settings.

Contact the support personal at JustHost.com, there are live chat available. You can tell them your issue and fix the server settings.

April 20, 2012

How to check if a folder exists using PHP

Question by edsonlp1

I have this code to check if a folder exists using PHP and it works correctly with xampp in windows, but when I try to move that page to a server, it doesn’t work.

Here is my code:

  function validate (&$valores, &$errores, $campo, $carpeta)
    {
    $valores [$campo] = $carpeta;
            if ((file_exists($carpeta) && is_dir($carpeta))==false)
            {
                    $errores[$campo] = true;                   
            }
            else
            {
                    $errores[$campo] = false;
            }
    }

There is an alternative to the code that I’m doing?

Thanks in advance

Answer by edsonlp1

Solution:
I added to PHP open_basedir folders and files I wanted to change, and then with Filezilla I’ve modified the read / write permission and fixed.

Answer by Starx

Your code should operate fine on both platforms, so its not this issue.

Usually, such problem due to the naming system. The linux based OS using strict case sensitive naming system.

So try to fix that.

...

Please fill the form - I will response as fast as I can!