Find the answer to your Linux question:
Results 1 to 6 of 6
Hello, I have installed on my OpenVz VPS: Ubuntu-8.04-i386-minimal and Webmin 1.490 I have installed Apache and PHP in standard directory. My web root is /var/www Here is my problem: ...
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    10

    How can PHP scripts "include" a no standard directory?

    Hello,

    I have installed on my OpenVz VPS:
    Ubuntu-8.04-i386-minimal and
    Webmin 1.490

    I have installed Apache and PHP in standard directory.
    My web root is /var/www

    Here is my problem:

    I have a PHP library and I do not want to put it inside my web root.

    I mean I have to put my library in the directory: /temp/lib

    How Can I make that PHP scripts can "include" them (/temp/lib)?

    BTW, I am a newbie in Linux

    Thanks

    Peace5

  2. #2
    Linux Newbie
    Join Date
    Nov 2007
    Location
    Planet Earth
    Posts
    152
    First, be sure that your dir has read access for every users.
    Then, modify in your php.ini file the 'include path' variable to add your directory.
    Finally, restart the apache daemon.

    Hugo
    EOF

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    10
    Thanks for your reply

    How can I do this "your dir has read access for every users"?

    Thanks again

    Peace5

  4. #4
    Linux Newbie
    Join Date
    Nov 2007
    Location
    Planet Earth
    Posts
    152
    From your file manager, check the properties of the dir, and verify that read permission for all users is activated (I'm not sure which file manager you use, but normally is pretty easy to verify the permission on the any GUI)

    JFYI, permissions in linux are on 3 levels: owner, group and others, and each level has read, write, execute flags.

    Hugo
    EOF

  5. #5
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,303
    First of all you need to make sure that the user that runs the apache process can access the folder. This is typically www-data in Ubuntu.

    chown: -R www-data: /path/to/your/files

    Then you need to include the files in your PHP scripts
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  6. #6
    Just Joined!
    Join Date
    Oct 2009
    Posts
    10
    Hello,

    The Lib cannot start


    I did this:

    Path: /temp/lib

    Step #1

    modify in your php.ini file the 'include path' variable to add your directory.
    Finally, restart the apache daemon.

    Step #2

    From your file manager, check the properties of the dir,
    and verify that read permission for all users is activated


    Step #3

    First of all you need to make sure that the user that runs the apache process can access the folder. This is typically www-data in Ubuntu.

    chown: -R www-data: /path/to/your/files

    Then you need to include the files in your PHP scripts

    Any suggestions are welcome!

Posting Permissions

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