how to change PHP include

I am setting up an Ubuntu LAMP installation to be used as a test webserver.

When I do "phpinfo();" on the production server, I get:

include_path   .:/home/mark/domains/xyz.com/site_specific

When I do the same on the test server I get:

include_path .:/usr/share/php:/usr/share/pear


So I edited the following file:

/etc/php5/apache2/php.ini

and changed the line from this:

;include_path = ".:/usr/share/php"

to this:

include_path = ".:/home/mark/domains/xyz.com/site_specific"


I rebooted the test server and did another "phpinfo();" but it didn't change.

What did I do wrong?



markgoodallAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HackneyCabCommented:
In phpinfo() what is the value of the parameter called "Loaded Configuration File"?

Possibly you edited a php.ini file which is not the one being used by your PHP executable. (Sometimes you find your machine littered with files that are more or less identical, but only one is actually in use.)
0
HackneyCabCommented:
Oh, and don't forget that there's not a great deal of point changing the value of php.ini settings on a test webserver to suit the paths on the test webserver. You want everything to match the live server (such as your shared hosting account) as closely as possible, otherwise your scripts will work on your test rig, but die with confused errors when you move them onto the live server.

Just something to think about.
0
markgoodallAuthor Commented:
Loaded Configuration File   /etc/php5/apache2/php.ini  

so I'm pretty sure I'm editting the correct file.

I need to change the php configuration so that it matches the production server exactly.
0
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Dave BaldwinFixer of ProblemsCommented:
Are the PHP versions the same?
0
markgoodallAuthor Commented:
Production Server:   PHP Version 5.2.5

Test Server: PHP Version 5.2.10
0
Dave BaldwinFixer of ProblemsCommented:
That should be close enough.  Have you compared the phpinfo() results from both to see what other differences there are?
0
markgoodallAuthor Commented:
There are 14 pages of phpinfo() results from each server and I'm not an expert on PHP in the first place, so I'm not sure what I'm looking for.  There are many differences, but I'd like to zero in one the important ones that could be causing this.

0
Dave BaldwinFixer of ProblemsCommented:
I think what you're seeing is that the Apache web server is setup on the Production Server to provide each user with their own options  and you won't be able to change that in the php.ini for Ubuntu.  Unless you change Apache also.  They do that to let users customize their setups without affecting the other users.
0
markgoodallAuthor Commented:
Okay, you've completely lost me now.

My website on the production server is here:

/home/mark/domains/xyz.com/trunk

and it needs to include files that are here:

/home/mark/domains/xyz.com/site_specific



The test website on the test server is here:

/home/mark/domains/xyz.com/trunk

and it fails when trying to access included files which are here:

/home/mark/domains/xyz.com/site_specific


So I want to make the php.ini files the same on both servers, so that the include path is the same on both servers.

I'm not sure what yuo mean by "to provide each user with their own options".   Aren't we talking about the same php.ini files and the same changes to the include_path in that file?

Sorry, but you've confused me.





0
Dave BaldwinFixer of ProblemsCommented:
Probably not.  If it's shared hosting, Apache and PHP are not configured the way they are on your (and my) Ubuntu system.  Often users are allowed on shared hosting to have their own 'php.ini' file in their own user area.  They're not allowed to change everything but they can do some customization.  That function is setup thru the Apache web server.  Even on your Ubuntu system (if you installed your server files from Ubuntu), there is more than one 'php.ini' file.  One is for the Apache webserver and the other is for comand-line applications.
0
markgoodallAuthor Commented:
Oh, would this apply to a Ubuntu LAMP Test server (running on an old Dell computer) versus a CentOS Production server runing on a dedicated server?
0
Dave BaldwinFixer of ProblemsCommented:
They could easily be different.  'Dedicated server' usually means that you are the only one on the server (dedicated to you).  But the path you showed above is a user/home path that is usually used on 'shared hosting' where there is more than one user on the system.  I don't have a CentOS (RedHat derivative) server but they aren't actually 'required' to put things in the same place.  The difference between 'dedicated' and 'shared' is more important.

Thinking about it, what files do you have on the production server at '/home/mark/domains/xyz.com/site_specific'?
0
markgoodallAuthor Commented:
The production server is defintely a dedicated server, defintely not shared hosting server.

I'm familiar with shared hosting, where different companies all share part of one server, and this is defintely not that.  I've also setup alot of servers (physical) at Co-Location facilities, and while I can't be sure, I believe this might be the case.  

Eitherway, the production server is "dedicated" as far as I can say. I was told to install Ubuntu/LAMP as a test enviroment since that should mimic the production server almost exactly.

All the PHP files are in a folder  /home/mark/domains/xyz.com/trunk
For instance:
/home/mark/domains/xyz.com/trunk/index.php
/home/mark/domains/xyz.com/trunk/front_end_code/modules/main.php

There are some includes, mostly related to setting global variables, database, etc, like:
dbconnect.php
globals.php
front_initialization.php
etc

Oh, also the "mark" and "xyz.com" are made up for posting here as the real values related directly to a real company.
 





0
Dave BaldwinFixer of ProblemsCommented:
The files you're listing in 'trunk' are not the 'normal' PHP includes but user files.  On both my Ubuntu and Windows systems, the "include_path" leads to PHP language extensions, not user files.

Is some kind of PHP based 'framework' installed on the production server?
0
markgoodallAuthor Commented:
I'm sorry the "trunk" folder name is used on the SubVersion repository server for this system. That folder is really named "public_html".  

Yes, it seems like some sort of PHP framework for a content management driven system with it's own adminkit.

I was given a copy of the phpinfo() from the production server and told to use that to help setup the test server.   The PHP system fails with error messages saying it can't find the files that are located in the /site_specific folder.   If I go and alter the PHP file and add that path to the include_path, then it finds it.   However, there are dozens (if not more) PHP I'd have to change to make this work, which isn't feasible.   I know I have add it to the system include_path to make it work without having to alter all the PHP files.

I just can't figure out why the phpinfo() on the test server doesnt' reflect the change that I made.
 
0
Dave BaldwinFixer of ProblemsCommented:
I'd try installing the CMS on your test server and see if that changes the settings.
0
markgoodallAuthor Commented:
That's what I'm doing... I'm trying to install it on the test server.

It's not a CMS that you "install", it's a huge PHP website that draws a certain amount of it's content from a MySQL database, and part of the PHP code is the adminkit that let's the administratiors add data to the database.  

I was told to:

Install LAMP on a Ubuntu system.
Configure PHP acording to the info from the phpinfo() sheet from the production server
Copy all the PHP files to the test server
Create the MySQL database based on a .sql file generated from the production database
0
Dave BaldwinFixer of ProblemsCommented:
What are you supposed to do then?
0
markgoodallAuthor Commented:
I will have a fully functioning test server.  

Then the changes I make in DreamWeaver can be copied(FTP) to the test server, I can access the test server with IE and make sure it looks/functions as expected, then I can commit the changes to the SVN repository server and update the production server with the changed php files.

0
TobiasHolmCommented:
Hi!

Maybe you could make a backup of your production server, make a clean install of the test server and then restore the backup to the test server? Sounds like the easiest way to set up an identical test environment.

Regards, Tobias
0
Dave BaldwinFixer of ProblemsCommented:
Sorry I let this slip.  I think you've been asked to do a task that can be much more difficult than the instructions you listed.

I'm used to doing it so I forgot to ask if you were using 'gksudo' so you could temporarily become root to edit the config file (which are owned by root)?  Ubuntu doesn't normally allow a 'root' login and you have to do all system changes thru 'sudo' or 'gksudo' which allows you to temporarily act as 'root'.  

You also have to create a user under the name that is used on the production server.  You may also have to use the same password.  Depends on how the PHP software is written.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
markgoodallAuthor Commented:
Well it's still not working... no solution I guess :(
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.