Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    php web path setting

    Hello !

    I have a website script that needs to be first installed on the server. When i run the install script on my wamp local server it gave me errors for this line

    Code:
    if(file_exists($_SERVER['DOCUMENT_ROOT'].'/data/uploads/language/config.php')) {
    i added folder name in the path and it worked.

    i.e
    Code:
    if(file_exists($_SERVER['DOCUMENT_ROOT'].'/foldername/data/uploads/language/config.php')) {
    then i uploaded the site online on 000webhost, direclty uploaded the files in "public_html" folder again it gave me path error on my default path, this time i didn't upload the folder but files inside it.

    So i decided to add "public_html" in the string , it didn't work either.

    Here is live demo of my site : http://naidese.hostzi.com/install/index.php

    Kindly help me solve this problem.

    Thanks

  • #2
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    Copy and upload this small script ... call it "test.php"
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    Now go to that URL (yoursite/test.php). It will display all of your PHP configuration and settings. Locate the part about 'document root' (in the Environment section) and see what the settings are for your website.



    .

  • Users who have thanked mlseim for this post:

    jahanzebg (03-11-2013)

  • #3
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    @mlseim sir thank you for your reply !

    i uploaded the file here it is : http://designjtest.comuv.com/test.php

    in found that the root path is :
    Code:
    /usr/local/apache/bin/httpd
    but it also gave error also tried many combinations but in vain.

    Any idea.

    Thanks

  • #4
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    How about:

    if(file_exists('config.php')) {

    If your PHP scripts are in the same directory, you don't have to define a path.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •