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 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question using includes w/ godaddy host

    Does anybody know how to make the include() function work on a godaddy.com host. I tried using the .htaccess method that is on the web but that doesn't help. I get the following:

    Warning: main(1): failed to open stream: No such file or directory in /home/content/e/r/i/ericjacobson01/html/index.php on line 4

    Warning: main(1): failed to open stream: No such file or directory in /home/content/e/r/i/ericjacobson01/html/index.php on line 4

    Fatal error: main(): Failed opening required '1' (include_path='.:/usr/local/lib/php') in /home/content/e/r/i/ericjacobson01/html/index.php on line 4

    Line four is where my include is located.
    I placed the
    or die(mysql_error());
    and this is what i got. The hosting is being run on Linux. Can anyone help?

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    It looks like the file doesn't exist:
    Quote Originally Posted by nervegas87 View Post
    Warning: main(1): failed to open stream: No such file or directory in /home/content/e/r/i/ericjacobson01/html/index.php on line 4

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    2,958
    Thanks
    2
    Thanked 304 Times in 296 Posts
    You would need to post your code to get any specific help with it.

    You either have the wrong path or a file name that does not exist. Because of this part of one of the errors - Failed opening required '1' your syntax in the require/include statement is probably wrong, but you would need to post your code for anyone here to help you with it.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    New Coder
    Join Date
    Mar 2007
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here are my opening lines:
    PHP Code:

    <?php

    require("connect.php") or die(mysql_error());
    require_once(
    "table.php") or die(mysql_error());

    ?>

  • #5
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    why do you have or die(mysql_error()) on a require and require_once statement?

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    use the full path...
    PHP Code:
    <?
    require('/home/content/e/r/i/ericjacobson01/html/connect.php');
    require(
    '/home/content/e/r/i/ericjacobson01/html/table.php');
    ?>
    also note that require() will die with a fatal error if the file can not be found.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #7
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Quote Originally Posted by rafiki View Post
    why do you have or die(mysql_error()) on a require and require_once statement?
    I am interested in hearing the answer to this question as well.

  • #8
    New Coder
    Join Date
    Mar 2007
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i've tried firepages' solution, but it's still not working.
    mysql_error...i got used to that since i am working w/ a lot of mysql recently, sorry if it gave you guys any doubts
    The or dies were just me trying to get a more descriptive error anyways, but i see that it is no good.

    I still believe that this is a godaddy.com error though, i was hoping that maybe i could create another path with the ini_set() function, but after experimenting a little bit w/ it i don't get any results...
    I am truly stuck


  •  

    Posting Permissions

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