[PHP] Problems installing smarty on a shared host
Hi folks. I've recently moved my site to a shared host, and this is the first time I've had to set up my site in a really restrictive environment, and I'm running into problems getting smarty installed. Using the basic example set up from the Smarty docs, when I run the file I get the following error: Warning: main(Smarty.class.php): failed to open stream: No such file or directory in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 Fatal error: main(): Failed opening required 'Smarty.class.php' (include_path='.:/php/includes:/usr/share/php:/home/pablogosse/smarty/') in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 Now, as you can see by the value of my include path, I've got the path to smarty added, but it's still not finding the file even though /home/pablogosse/smarty/Smarty.class.php does indeed exist. Can anyone tell me why this is happening? As I said up until now I've been lucky enough to always have access to dedicated servers where setting this up was never a problem, but I know there's something I'm missing in understanding why this isn't working. Any help is appreciated. Cheers and TIA. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems installing smarty on a shared host
Pablo Gosse wrote: Hi folks. I've recently moved my site to a shared host, and this is the first time I've had to set up my site in a really restrictive environment, and I'm running into problems getting smarty installed. Using the basic example set up from the Smarty docs, when I run the file I get the following error: Warning: main(Smarty.class.php): failed to open stream: No such file or directory in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 Fatal error: main(): Failed opening required 'Smarty.class.php' (include_path='.:/php/includes:/usr/share/php:/home/pablogosse/smarty/') in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 You are including from file that is located in /home/virtual/site357/fst/var/www/html/, and the smarty class is in /home/pablogosse/smarty/? The paths seems strange, what if you try include_path = /home/virtual/site357/+ whatever is the relative path to Smarty.class.php from smarty.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems installing smarty on a shared host
I tried that and got the same error. I'm trying to place the smarty directories outside my webroot to minimize security risks, however given my experiences thus far, I don't really see that being possible. Would a viable solution perhaps to be to include the smarty directories in the webroot such that my scripts can access them, but to protect the directories via .htaccess to prevent direct execution of files from said directories, since my scripts will be including them but are themselves executed from valid locations? Cheers and TIA, Pablo -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Saturday, September 25, 2004 1:52 PM To: Pablo Gosse Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Problems installing smarty on a shared host Pablo Gosse wrote: Hi folks. I've recently moved my site to a shared host, and this is the first time I've had to set up my site in a really restrictive environment, and I'm running into problems getting smarty installed. Using the basic example set up from the Smarty docs, when I run the file I get the following error: Warning: main(Smarty.class.php): failed to open stream: No such file or directory in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 Fatal error: main(): Failed opening required 'Smarty.class.php' (include_path='.:/php/includes:/usr/share/php:/home/pablogosse/smarty/') in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 You are including from file that is located in /home/virtual/site357/fst/var/www/html/, and the smarty class is in /home/pablogosse/smarty/? The paths seems strange, what if you try include_path = /home/virtual/site357/+ whatever is the relative path to Smarty.class.php from smarty.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems installing smarty on a shared host
Pablo Gosse wrote: I tried that and got the same error. I'm trying to place the smarty directories outside my webroot to minimize security risks, however given my experiences thus far, I don't really see that being possible. It should not matter, unless open_basedir is in effect, but that would be another error. I would check if the directories are right, you can start by using relative path. Would a viable solution perhaps to be to include the smarty directories in the webroot such that my scripts can access them, but to protect the directories via .htaccess to prevent direct execution of files from said directories, since my scripts will be including them but are themselves executed from valid locations? Cheers and TIA, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems installing smarty on a shared host
[snip] I'm trying to place the smarty directories outside my webroot to minimize security risks, however given my experiences thus far, I don't really see that being possible. It should not matter, unless open_basedir is in effect, but that would be another error. I would check if the directories are right, you can start by using relative path. [/snip] It appears I've found the problem. I used passthru(ls -l [dirname],$ret) to start reading from /home all the way up through the following: /home/ /home/virtual/ /home/virtual/site357/ /home/virtual/site357/fst/ and all returned complete directory listings and a return code of 0. Now, when I read through /home/virtual/site357/fst/var/ /home/virtual/site357/fst/var/www/ /home/virtual/site357/fst/var/www/html/ I see the files that I would see when I SSH in and ls -l the following paths: /var/ /var/www/ /var/www/html/ HOWEVER, when I attempt the passthru call on /home/virtual/site357/fst/home/ I get no results back, and the return code is 1. So it appears scripts running under the apache user cannot access that folder or anything beneath it Any ideas? Cheers and TIA. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems installing smarty on a shared host
[snip] It should not matter, unless open_basedir is in effect, but that would be another error. I would check if the directories are right, you can start by using relative path. [/snip] Just the relative path from smarty.php, ../../../home/pablogosse/smarty/Smarty.class.php And I get a permission denied error. So it appears for sure that I can't read anything inside my home directory, or outside the webroot it would seem. Any ideas? Cheers and TIA, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems installing smarty on a shared host
Pablo Gosse wrote: [snip] It should not matter, unless open_basedir is in effect, but that would be another error. I would check if the directories are right, you can start by using relative path. [/snip] Just the relative path from smarty.php, ../../../home/pablogosse/smarty/Smarty.class.php And I get a permission denied error. So it appears for sure that I can't read anything inside my home directory, or outside the webroot it would seem. Any ideas? Then put it in webroot. You should protect template and compiled template directories using .htaccess. Smarty.class.php does not really matter, it only defines a class. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems installing smarty on a shared host
* Thus wrote Pablo Gosse: Hi folks. I've recently moved my site to a shared host, and this is the first time I've had to set up my site in a really restrictive environment, and I'm running into problems getting smarty installed. Using the basic example set up from the Smarty docs, when I run the file I get the following error: Warning: main(Smarty.class.php): failed to open stream: No such file or directory in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 Fatal error: main(): Failed opening required 'Smarty.class.php' (include_path='.:/php/includes:/usr/share/php:/home/pablogosse/smarty/') in /home/virtual/site357/fst/var/www/html/smarty.php on line 4 Now, as you can see by the value of my include path, I've got the path to smarty added, but it's still not finding the file even though /home/pablogosse/smarty/Smarty.class.php does indeed exist. You'll probably notice that the permissions for /home/pablogosse are like: drwxr-x--- with user:group pablogosse:pablogosse If you have permissions to, i would set up a directory like: /home/virtual/site357/fst/var/include/smarty/ And then set the include_path appropriatly. Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems installing smarty on a shared host
[snip] You'll probably notice that the permissions for /home/pablogosse are like: drwxr-x--- with user:group pablogosse:pablogosse If you have permissions to, i would set up a directory like: /home/virtual/site357/fst/var/include/smarty/ And then set the include_path appropriatly. [/snip] Unfortunately I don't have write access to /var as it is owned by root. I've just discovered another thing which makes me even more nervous. I just wrote a script as a quick test and I was able to use file_get_contents to read a file out of another user's webroot. So, anyone who is storing passwords or other valuable information under their webroot risks having that information being easily accessible to anyone else hosting here. As I said earlier, most of my experience until now has been in situations where the sites I've worked on have been hosted on dedicated servers, and this has never been a problem. Is this a common set up for shared hosting? Is there any way around this? Cheers and TIA, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php