WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #37220


Ignore:
Timestamp:
06/29/2016 08:21:09 AM (5 years ago)
Author:
ocean90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37220 – Description

    initial v1  
    11Hello,
    2 i noticed working on a wordpress website that if the website is in a directory (es. /var/www/releases/3/) and the web root is pointing through a symbolic link ( so. /var/www/current/ pointing to /var/www/releases/3/ ) the function in the wordpress config is not retrieving the right directory:
     2i noticed working on a wordpress website that if the website is in a directory (es. `/var/www/releases/3/`) and the web root is pointing through a symbolic link ( so. `/var/www/current/` pointing to `/var/www/releases/3/` ) the function in the wordpress config is not retrieving the right directory:
    33
     4
     5{{{
    46if ( !defined('ABSPATH') )
    57        define('ABSPATH', dirname(__FILE__) . '/');
     8}}}
    69
    7 I solved manually defining ABSPATH to the right directory, but i think it would be better to fix if maybe checking if the directory is a symlink.
    810
    9 The problem is that from php5 __FILE__ is reporting the absolute path, so it may be better to use $_SERVER['PWD'] to retrieve the path:
    10 <?php echo $_SERVER['PWD'] ."\n"; ?>
     11I solved manually defining `ABSPATH` to the right directory, but i think it would be better to fix if maybe checking if the directory is a symlink.
     12
     13The problem is that from php5 `__FILE__` is reporting the absolute path, so it may be better to use `$_SERVER['PWD']` to retrieve the path:
     14`<?php echo $_SERVER['PWD'] ."\n"; ?>`
    1115would be
    12 /var/www/current
     16`/var/www/current`
    1317
    1418Thanks,