Vermillion Posted January 30, 2009 Share Posted January 30, 2009 First, I hope I got the right forum... I use [http://www.07x.net 07x] (which sucks btw, but can't find anything better) as my host. I want to install Smarty because it seems like that thing owns when it comes to separate HTML from PHP. I have found [http://news.php.net/php.smarty.dev/2703 this guide] (well, Huntyr linked me to it ;P), and the main problem is that I can't modify the php.ini file to add a new includes location. I know I could change the installation guide a bit, but I heard that keeping the Smarty files out of the htdocs/www folder is safer. If anyone has a possible solution, I will highly appreciate it ._.. Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/ Share on other sites More sharing options...
phparray Posted January 30, 2009 Share Posted January 30, 2009 You can set your include path by using ini_set() prior to everything else. This works best if done in an include file that is always loaded first. ini_set('include_path', ini_get('include_path') . ':'/path/to/the/additional/path/'); And since you mentioned it Hostmysite.com has some pretty awesome hosting. Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750366 Share on other sites More sharing options...
trq Posted January 30, 2009 Share Posted January 30, 2009 Even simpler... set_include_path(get_include_path() . ':/path/to/smarty'); Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750439 Share on other sites More sharing options...
Vermillion Posted January 30, 2009 Author Share Posted January 30, 2009 Woah woah, that's certainly something. Thorpe, if I used your method, can I actually set that include path to a folder that is out of my www/htdocs folder? And I am assuming I will need to include that on every file that uses Smarty, right? Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750468 Share on other sites More sharing options...
phparray Posted January 30, 2009 Share Posted January 30, 2009 Opps sorry looks like there is a syntax error in mine. Here is mine correct. ini_set('include_path', ini_get('include_path') . ':/path/to/the/additional/path/'); thorpe's is better though. I forgot about the php functions for set_include_path() and get_include_path(). This is a cleaner way. And yes the absolute path does not have to be in your web root. Specify it from the servers root. What you want to do is create a config file for your application that always gets run first. Just put this in that config file then include that file at the top of all outward facing files. Never duplicate code. Write it once and reuse it. Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750594 Share on other sites More sharing options...
Vermillion Posted January 30, 2009 Author Share Posted January 30, 2009 Will set_include_path() modify the php.ini file? I used get_include_path(), and I don't know where I will find this: .:/usr/share/php:/tmp lol Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750876 Share on other sites More sharing options...
trq Posted January 30, 2009 Share Posted January 30, 2009 Will set_include_path() modify the php.ini file? I used get_include_path(), and I don't know where I will find this: .:/usr/share/php:/tmp lol No, it won't modify your php.ini. It simply sets your include_path at runtime. The reason we use get_include_path inside the call to set_include_path is so that we can add to the current path. Your path is a list of directories seperated by : So, your current path contains threee directories. . <- the directory your script executes from. /usr/share/php <- a common php include. This is where things like PEAR, Zend Framework and Smarty are usually installed. /tmp <- The systems temporary directory. Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750947 Share on other sites More sharing options...
Vermillion Posted January 30, 2009 Author Share Posted January 30, 2009 Ah okay, thanks for that. Just refresh my memory. usr/share/php Inside the "php" directory, I have the htdocs directory, right? I can't check all the directories since I am on FTP to upload the files, I can just the directory that keeps htdocs inside. Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-750962 Share on other sites More sharing options...
trq Posted January 31, 2009 Share Posted January 31, 2009 Inside the "php" directory, I have the htdocs directory, right? I can't check all the directories since I am on FTP to upload the files, I can just the directory that keeps htdocs inside. No, if your on a shared server your htdocs directory is normally within your home directory somewhere. Something like /home/username/htdocs. /usr/share/php is (as I said in my previous reply) normally where shared libraries (like zend framework, pear and even smarty) are installed. On a shared host you won't have control over whats in /usr/share/php but you can use whatever is in there becuasde its in your include path. Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-751618 Share on other sites More sharing options...
dhie Posted February 19, 2009 Share Posted February 19, 2009 hey! admin help me pls??!! can anyone try to help me coz i am thinking how can i will include the temporary password in my my site can anyone give me the code or script?! Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-765729 Share on other sites More sharing options...
corbin Posted February 19, 2009 Share Posted February 19, 2009 What are you talking about? Quote Link to comment https://forums.phpfreaks.com/topic/143055-installing-smarty-when-i-cant-modify-phpini/#findComment-765751 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.