Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541

    php4 -> 5 .htaccess / php code help

    This error is shown when I load the site with php5 and the global variables stop working as well.

    Warning: session_start() [function.session-start]: open(/tmp/sess_d61169214ef7571279ef183e6894bbc0, O_RDWR) failed: Permission denied (13) in /home/site/public_html/kernel/init/session_start.php on line 4 (line 4 is "session_start();")

    This is what is required in my htaccess for my site to operated under php4. What do I have to change in order to get php5 to load the site properly?
    Code:
    # Use PHP4 as default
    AddHandler application/x-httpd-php4 .php .php4 .php3 .phtml .tpl .html
    DirectoryIndex index.php
    Options -Indexes
    Options +FollowSymLinks
    
    <IfModule mod_rewrite.c>
    RewriteEngine On		
    
    RewriteCond %{HTTP_HOST} ^(site\.com)$ [NC] 
    RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
    
    RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
    RewriteCond %{HTTP_HOST} !^(www\.)?site\.com$ [NC] 
    RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.site\.com$ [NC] 
    RewriteRule ^(.*)$ http://www.site.com/view/%2.html [R=301,L]
    RewriteCond %{REQUEST_URI} !^ads/
    RewriteCond %{REQUEST_URI} !^shop/
    RewriteCond %{REQUEST_URI} !^mp3/
    RewriteCond %{REQUEST_URI} !^swf/
    RewriteCond %{REQUEST_URI} !^js/
    RewriteCond %{REQUEST_FILENAME}  !-d
    RewriteCond %{REQUEST_FILENAME}  !-f
    RewriteRule ^(.*) index.php [L]
    </IfModule>
    
    php_flag register_globals on
    php_value max_execution_time 1200
    php_value memory_limit 300M
    php_value post_max_size 300M
    php_value upload_max_filesize 300M

  2. #2
    Check php.ini and find the session.save_path. Make sure that the file mentioned exists and is writable.
    Support Facility | 24/7 web hosting technical support services
    Technical support | Server management | Data migration

    Technical Articles

  3. #3
    Join Date
    Jun 2008
    Posts
    1,471
    Yeah, your session save directory appears to be /tmp/ and its not writable by PHP.

    Everything else in your .htaccess should work just fine, although register globals is deprecated.

  4. #4
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    the /tmp/ folder is set to 755 already

  5. #5
    Join Date
    Mar 2009
    Location
    Gods Own Country
    Posts
    681
    /tmp is supposed to be 777
    Fabin Mundattil @ Xieles Support
    High Quality Server Management | support @ xieles.com
    http://xieles.com

  6. #6
    Join Date
    Jun 2008
    Posts
    1,471
    755 only gives write access to the owner of the folder (ie root). Other users only have read and execute access. Your web server, Apache, is usually run as the Apache user, thus it can't write to the folder.

Similar Threads

  1. need help in changing code to lighthttpd htaccess from apache
    By koolnhot in forum Hosting Security and Technology
    Replies: 5
    Last Post: 07-14-2009, 08:09 AM
  2. No Hotlink Code .. Which .htaccess file?
    By LBSources in forum Programming Discussion
    Replies: 2
    Last Post: 06-22-2008, 12:29 AM
  3. What do you think this htaccess code does?
    By lexington in forum Programming Discussion
    Replies: 3
    Last Post: 04-19-2008, 12:47 PM
  4. .htaccess Custom 404 Error Page returning 200 code
    By Lanny in forum Hosting Security and Technology
    Replies: 10
    Last Post: 08-09-2007, 07:42 PM
  5. Need help with .htaccess hotlink code!
    By sir_han in forum Programming Discussion
    Replies: 0
    Last Post: 06-28-2007, 06:05 AM

Posting Permissions

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