Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP breaks Apache on CentOS 6.5

Posted on 2014-02-16
2
Medium Priority
?
1,134 Views
Last Modified: 2014-02-17
I have finished configuring a fresh Joomla installation on a CentOS 6.5 server.
I then proceeded to upgrade Joomla to the latest version from the admin panel.
The upgrade produced an error about not being able to copy robots.txt.dist and stopped.
As I could no longer access the web admin interface I proceeded with restarting the httpd service.
After I had done this, upon trying to access Joomla I got a blank page.
I then deleted all the Joomla files and made a fresh copy from the downloaded archive from the Joomla webpage, but upon trying to access the web configuration I got a blank page again.
I then removed Joomla completely and reinstalled php and php-mysql with yum.
That didn't help so i removed both php packages completely.
After doing that I got the default apache webpage loading again.
I then installed php and php-mysql again, after which I immediately get a blank page when trying to access the homepage or a test script index.php.

How could I remove all traces of php config and do a fresh install or should I do something else?
0
Comment
Question by:proteus-IV
2 Comments
 

Accepted Solution

by:
YoavZ earned 1500 total points
ID: 39863499
More information is needed, mostly log files.

Please attach a copy of Apache access logs / error logs - most probably located at /var/lib/httpd

Provide us with the output of `httpd -M`.

If re-installing the server is a quick possibility (in case of cloud server) I suggest installing the server and running the following:

yum -y update
yum install httpd mysql mysql-server php php-mysql
chkconfig httpd on
chkconfig mysqld on
/usr/bin/mysql_secure_installation
service httpd restart
service mysqld restart

The following commands will get you up and running in 5 minutes of setup on a clean CentOS 6 installation.

Although I know that common CMS systems have RPM packages available, I strongly suggest against using them.
Installing Wordpress is as easy as:
cd /var/www/html
wget http://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz

And you are done!
0
 

Author Closing Comment

by:proteus-IV
ID: 39864117
I checked the apache error_log and found out that it is mentioning "open_basedir" and stating that it cannot access it.
I then proceeded to edit php.ini and I commented out "open_basedir = /tmp".
After that I restarted httpd and php scripts started displaying in the browser.

Thanks for your help.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question