Locating local directory for localhost - wordpress

I've been spending hours trying to locate where localhost's files are stored.
I've tried looking at the page source but all it tells me is http:/localhost/....
which is not what I need.
My Xampp directory (where I load Xampp control) is located in my desktop but there is no change when I alter stuff inside its htdocs.

The default root for XAMPP, assuming you installed in the default location, is c:\xampp\htdocs. You can change this by modifying the Apache configuration in c:\xampp\apache\conf\httpd.conf.

You can always check it through PHP:
echo $_SERVER["DOCUMENT_ROOT"];
Or if you want to use WordPress functions:
echo get_stylesheet_directory();
Include these codes in your page.php or header.php for example.

Related

Finding the path of a specific WordPress install

I have recently taken over a WordPress website.
Once I got access to the server I found that there were more than 70 installations of WordPress spread across it (files and DBs).
What is the quickest/easiest way for me to determine which installation is the one that is running the actual live website?
I thought of putting a PHP file into each installation (a file that echoed something along the lines of $_SERVER['PHP_SELF'];) - then try and access that file from the site itself, from there I know which installation is the correct one (I can then work out which DB is the correct one from the wp-config).
But surely there is an easier way? I have access to wp-admin, is there anything I can do in there to show me the base install path of this particular WordPress?
Save the follwoing code into a php file and put it into the root foler. This will list all the folders which have the WordPress installation.
<?php
$dirs = array_filter(glob('*'), 'is_dir');
foreach($dirs as $dir)
{
$path=$dir.'/wp-config.php';
if(file_exists($path))
{
echo $dir.'<br>';
}
}

What is the correct path to a file "below" the root?

I have a bitnami Wordpress installation. When navigating via FTP, the directory tree to Wordpress is home/bitnami/apps/wordpress/htdocs. When browsing, this acts as the root directory.
I have added several packages I need to use via Composer (AWS SDK, Facebook SDK, etc.) Composer installs these packages at home/bitnami/vendor. I can't seem to find the right path to these files.
I created a file called "test.php" in a subdirectory of the Wordpress root called test-dir (home/bitnami/apps/wordpress/htdocs/test-dir/test.php). I want to require the file home/bitnami/vendor/required.php in test.php. What would be the correct path to required.php? Here is my first guess (which throws an HTTP ERROR 500):
test.php:
<?php
require '../../../../vendor/required.php';
What is the correct path?
The simple solution was to use the absolute path:
<?php
require '/home/bitnami/vendor/required.php';

wordpress script and content 404 network error absolute path error

Configuration used: ubuntu server 14.04, php-fps, nginx, mysql 5.6 & latest wordpress.
Under the webserver(nginx)
Configured the nginx absolute path as /var/www/html/wordpress/
but Under the wordpress directory:
the style sheets and image file types do not load(404 err) because they are looking for the path http://localhost/wordpress/wp-include & http://localhost/wordpress/wp-content .
As this wordpress directory is missing.
hence we had to create one more directory called "wordpress" and give the soft links to the wp-include & wp-content under this directory.
This being a temporary fix. where exactly do i need to make the changes.
I think that you should modify the site_url in the table in your database, where your site_url has been stored in the wp_option table. It might be http://localhost/your-site/ change it to http://localhost/wordpress/
Hope this helps...

Change the Wordpress URL

I would like to change the URL for my Wordpress:
From this: www.example.com/wordpress
To this: www.example.com/game
What do I need to do?
I tried renaming the Wordpress folder to game but this did not work. It caused a linkage problem with the bank-end database.
which server you are using.
if you are using apache or nginx you need to modify you vhost files accordingly to point to the right directory.
location of these file depend on you server's OS.
commonly it is in /etc/httpd/conf.d/ or /etc/apache2/conf.d/
Not open any file in this www.example.com/wordpress folder, Change permission this folder apply 755 permission, stop apache server or stop xampp. after rename your foder name and start apache server or xammp

Wordpress Blank Install Page

I uploaded a freshly downloaded copy of Wordpress 4.2.2 here: http://www.onedayonemillion.com/test/ and all I get is a blank page.
There are no .htaccess or wp-config.php files in the root directory.
No database has been connected yet.
I tried the same in another directory (/dev/) and it did the same.
I have no plugins installed or activated.
This is a fresh copy.
I added an phpinfo file here: http://www.onedayonemillion.com/test/info.php
Why can't I even get the install page to show up?
I didn't understand why there is no wp-config.php in the directory, it would be good you post what is in the directory. Anyway, you can check items like (sometimes it is just that):
some files with no ending "?>" ending the file;
any require_once methods calling non-existing files
(you said no, but) wp-config has wrong or non-set definitions (user, database)
check permissions/ownership to the folder
Well, I know it can be lame, but I had problem with definition in WPLANG define,
so I put an
echo "<br> there is no error until here";
through the files untill I find that was missing a comma at the definition. If the phrase is displayed, your installation files untill that point are working out.
Your phpinfo says the display_errors is off.
modify your php.ini with this line:
display_errors = on
you should restart the server after modification.
you can only track the error only if the error reporting is on in the server

Resources