Can't access my locally installed Wordpress site - php

I am running xampp, and I want to have multiple websites in the htdocs folder. When I just install Wordpress into the htdocs folder, it works fine. However, when I clone (from github) a pre-existing build of wordpress and place it into the htdocs folder (ex - htdocs/somesite.com) I cannot access it.
I get an error of:
Warning: require(C:\xampp\htdocs\mysite.com/wp-includes/load.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\mysite.com\wp-settings.php on line 21
Fatal error: require(): Failed opening required
'C:\xampp\htdocs\mysite.com/wp-includes/load.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\mysite.com\wp-settings.php on line 21
I am confused on two things:
I see the file there that is SAYS is missing in the directory. This I have triple and quadruple checked. I also do not understand the reference to the c:\xampp\php\PEAR path
I also do not know whether or not there are problems coming from the fact that the slashes between directories changing direction are causing the problem. Like why are they starting off with the "\" but then going to "/" after the "mysite.com".
This is the second time I have run into this problem. What am I doing wrong?

Related

Symlinks w/ Xampp Error

I currently use Xampp on Windows for a local web development. In my web root, I have symlinks to each of my projects like so:
http://i.stack.imgur.com/GW9Yt.png
When the symlink is followed via explorer, it opens up the correct folder and location however, when loaded via Apache in my browser (localhost/project) I receive this error:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:/xampp/htdocs/project/index.php' (include_path='.;C:\xampp\php\PEAR') in Unknown on line 0
The file index.php is located inside the directory the symlink is directed at.
I believe this is a permission error however I cannot seem to discover what might be causing this as I have individually checked the permissions of each folder, file, etc and can't seem to find the issue.
Something I have noticed is that files located in folders located inside folders inside the symlink, e.g. link/style/file.txt will load however those in the root directory of the symlink do not.
Even I faced the same problem while installing magento on XAMPP & Windows-7. This clearly solved my problem.
Stop the apache and mysql
Exit XAMPP
Click on start button and search for XAMPP
Right click on "XAMPP Control Panel" and "Run as administrator"
Now you start apache and mysql
Your symlinks should start working now

After installation, blank screen from Reportico

I've installed Reportico in /reportico under my website root. I set permissions for the folders template_c, projects and projects/admin to READ_&_EXECUTE, LIST_FOLDER_CONTENTS, READ, and WRITE for the user IIS_IUSRS. I've had PHP 5.3.28 running for months with the PDO extension working just fine, so no problems there.
When I browse to:
http://mywebsite/reportico/index.php
...it immediate forwards to:
http://mywebsite/reportico/run.php?project=admin&execute_mode=ADMIN&clear_session=1
...and I get a blank white screen.
I looked in the PHP logs and found this:
[27-Apr-2015 09:06:19 America/Tegucigalpa] PHP Warning: include(templates_c\%%62^620^6206D997%%admin.tpl.php): failed to open stream: No such file or directory in D:\inetpub\inventronicsusa\reportico\smarty\libs\Smarty.class.php on line 1256
[27-Apr-2015 09:06:19 America/Tegucigalpa] PHP Warning: include(): Failed opening 'templates_c\%%62^620^6206D997%%admin.tpl.php' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\inventronicsusa\reportico\smarty\libs\Smarty.class.php on line 1256
This is my first attempt to run Reportico. Any idea what I'm doing wrong?
Peter Deed, the author of the software, was very helpful; he helped me find the answer.
While the web site says:
...ensure that the following files and folders have write permission:-
templates_c
projects - where you will create report suites
projects/admin - for storing the Reportico admin configuration
...just setting Read/Write permission for them is not enough. The software needs the ability to delete from these folders. So, in IIS, that means you have to give it Modify permission in addition to the Read/Write permissions mentioned above.
Hope that helps someone down the line.

How does File paths on apache work (failed to open stream: No such file or directory)

Hi I have this database_setup script witten in php. I have a project in a Linux debian machine. The top of the file looks like this:
database_setup.php
require_once("../classes/admin.php");
require_once("../classes/client.php");
require_once("../classes/database.php");
require_once("./config.php");
But when I run php database_setup.php I get the following error:
PHP Warning: require_once(../classes/admin.php): failed to open stream:
No such file or directory in /path/to/the/file/database_setup.php on line 6
PHP Fatal error: require_once():
Failed opening required '../classes/admin.php'
(include_path='.:/usr/share/php:/usr/share/pear')
in /path/to/the/file/database_setup.php on line 6
When I run other code as usual with "normal" contact with the database (I mean the normal case being one where the files of models (as client and admin ) are in the same directory as the database) there is no fatal error or warning.
The config.php file contains the password and name of the db, and so on, which the database.php requires(_once). And the database_setup is in the same folder as the config file.
I really don't understand why the code works on my MAMP server on my mac but not on another system. Has it to do with apache2.conf or something else? Thanks.
I think that this
require_once("../classes/admin.php");
Will be relative to where you are running the php command from.
Try changing directory to the folder above classes and then running php database_setup.php
You can change directory via the command line like this
cd /var/www/httpdocs/classes

include_path error when trying to access app in localhost

I realize that a question thread already exists, but it has been closed since and the OP hadn't responded to the answer. The question thread can be found here: https://stackoverflow.com/questions/5547333/include-path-c-php5-pear
So, my problem is this:
I have my facebook app locally in my htdocs folder (my DocumentRoot) and it requires sdk/src/facebook.php. I receive the following error upon trying to view the page:
Warning: require_once(sdk/src/facebook.php) [function.require-once]: failed to open stream: No such file or directory in D:\Apache\Apache2\htdocs\www\immense-headland-4743\index.php on line 14
Fatal error: require_once() [function.require]: Failed opening required 'sdk/src/facebook.php' (include_path='d:\php\pear') in D:\Apache\Apache2\htdocs\www\immense-headland-4743\index.php on line 14
I have tried variations of the backslash and forward slash in my php.ini file; I have tried set_initial_path() and init_set() in my main index.php - but nothing works. What is going wrong here?
I failed to see the problem here because I was blindly following an existing code and did not look into it carefully. The solution was to look at the php.ini file and see where the include_path variable was pointing - it was pointing to my php installation folder while the php I required was in my apache folder. So I pointed the variable to that folder and now it works.
Courtesy:Cups in Trouble with local host PHP require_once
As he said : If you put your include/ folder into this folder;
/Users/jfloyd/IOD/includes/
Then alter this line in your PHP ini from:
include_path='.:/Applications/MAMP/bin/php/php5.4.10/lib/php'
TO
include_path='.:/Applications/MAMP/bin/php/php5.4.10/lib/php:/Users/jfloyd/IOD/'
Then save the file and restart your server, then the include files should be found.
This ini directive can be set in any number of places, in each file, in each folder using .htaccess or in httpd.conf or in the ini file, as I just described.

Linux: File both exists and not exists

I am writing a PHP application, and I've just encountered a really wierd error. After a recent move to a new (Ubuntu) server, i started getting fatal errors on a require_once statement. So obviously the file doesn't exist, or the file permissions are wrong, right?
No, as it turns out:
The file does exist
The file is checked out from an SVN repository. When I go into the folder and list the files (ls or ls -l) the file is clearly there and has the correct file size. When I update the file in the repository and update the working copy, the changes are copied to the working copy. The file has permissions 755, so everyone should be able so see and read it. Other files in the same directory are working just fine.
The file also doesn't exist:
PHP exits with a fatal error because the file can't be found. If I use the find-command, the file is not found. If I try to use nano to edit the file, it claims it does not exist. If I start typing the filename and press tab to autocomplete, it can't find the file.
This behaviour has now happened on two separate servers, but it works fine on a third server. All the servers run Ubuntu 10.04.
Does anyone have any idea what is going on?
EDIT:
File name is AdminIpv4RangeAddFormHandler.inc.
Full error message, with file paths obscured:
Warning: require_once(fullpath/AdminIpv4RangeAddFormHandler.inc): failed to open
stream: No such file or directory in fullpath/anotherfile.inc on line 34 Fatal error:
require_once(): Failed opening required 'fullpath/AdminIpv4RangeAddFormHandler.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in fullpath/anotherfile.inc on line
34
The following command produces no output:
find -name AdminIpv4RangeAddFormHandler.inc -ls
A regular ls -li outputs (amongst others) this row:
2233407 -rwxr-xr-x 1 root root 1597 2011-12-13 08:02 AdminIPv4RangeAddFormHandler.inc
Be careful switching OS's, as some are case sensitive, and others aren't.
I use my Mac for development (case insensitive), so it doesn't matter what casing I use for file_exists() or include_once() etc. Then I deployed to Ubuntu 11 (case sensitive), and all my includes stopped working. I suspect you have the same exact problem.
The tricky part for me was, while using git, my version control didn't detect changes in file name case as a modification. I actually had to rename every file with some sort of prefix, commit and deploy, rename them back to what they should be (with consistent capitalization!), and finally commit and deploy again. It was a complete pain.
Moral of the story--code for your production system, not your dev system.
Take a good long look at your filenames:
AdminIpv4RangeAddFormHandler # from PHP
AdminIpv4RangeAddFormHandler # from find command
AdminIPv4RangeAddFormHandler # from ls output
^
You should pick IP or Ip and stick with the decision everywhere.

Categories