RRT Posted August 7, 2009 Share Posted August 7, 2009 PHP pages won't open at all on my server. HTML pages open fine, but when going to the PHP pages that are on my server, the browser tries to download the page like a file instead of presenting it by the browser. What can I do to make the PHP processor to be handled properly? Do I need to recompile it again, and if so, what switches should I use? Quote Link to comment Share on other sites More sharing options...
Zyx Posted August 7, 2009 Share Posted August 7, 2009 You haven't informed the server to parse PHP files as PHP. You haven't said, what web server you are using, so I'm not able to give you further information. Quote Link to comment Share on other sites More sharing options...
RRT Posted August 8, 2009 Author Share Posted August 8, 2009 How to I set it to do that? I am running Apache version 2.2.11. Quote Link to comment Share on other sites More sharing options...
trq Posted August 8, 2009 Share Posted August 8, 2009 What distro are you using and how did you install php & apache? Quote Link to comment Share on other sites More sharing options...
RRT Posted August 8, 2009 Author Share Posted August 8, 2009 I'm on Fedora 2.6.11-1.1369_FC4 on that particular server. I'm running PHP 5.2.9 which I downloaded directly from the php web site, then untarred, ran make, and make install commands as described in the php INSTALL file that was included with the distribution.. ================== Example 2-4. Installation Instructions (Apache 2 Shared Module Version) 1. gzip -d httpd-2_0_NN.tar.gz 2. tar xvf httpd-2_0_NN.tar 3. gunzip php-NN.tar.gz 4. tar -xvf php-NN.tar 5. cd httpd-2_0_NN 6. ./configure --enable-so 7. make 8. make install ================== You will probably try to talk me into using yum, which I have already tried to do, but it will not work on my system; it always fails on 'setting up repositories'. Fixing this will have to be another project on its own and in th future. Quote Link to comment Share on other sites More sharing options...
Third_Degree Posted August 8, 2009 Share Posted August 8, 2009 XAMPP maybe? http://www.apachefriends.org/en/xampp-linux.html Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 8, 2009 Share Posted August 8, 2009 I'm on Fedora 2.6.11-1.1369_FC4 on that particular server. I'm running PHP 5.2.9 which I downloaded directly from the php web site, then untarred, ran make, and make install commands as described in the php INSTALL file that was included with the distribution.. ================== Example 2-4. Installation Instructions (Apache 2 Shared Module Version) 1. gzip -d httpd-2_0_NN.tar.gz 2. tar xvf httpd-2_0_NN.tar 3. gunzip php-NN.tar.gz 4. tar -xvf php-NN.tar 5. cd httpd-2_0_NN 6. ./configure --enable-so 7. make 8. make install ================== You will probably try to talk me into using yum, which I have already tried to do, but it will not work on my system; it always fails on 'setting up repositories'. Fixing this will have to be another project on its own and in th future. You will also need to configure Apache with PHP too. You need to add something like the following to Apaches config file (httpd.conf) LoadModule php5_module "/full/path/to/php/php5apache2_2.so" AddType application/x-httpd-php .php However you are better of using YUM to install Apache, PHP. It will take care of everything for you. Quote Link to comment Share on other sites More sharing options...
RRT Posted August 10, 2009 Author Share Posted August 10, 2009 These are the .so files that I could find on my server. Which module(s) should I load to get PHP working with Apache?: ============ /usr/lib/httpd/modules/libphp5.so /usr/lib/httpd/modules/mod_imap.so /usr/lib/httpd/modules/mod_vhost_alias.so /usr/lib/httpd/modules/mod_unique_id.so /usr/lib/httpd/modules/mod_info.so /usr/lib/httpd/modules/mod_alias.so /usr/lib/httpd/modules/mod_mem_cache.so /usr/lib/httpd/modules/mod_access.so /usr/lib/httpd/modules/mod_asis.so /usr/lib/httpd/modules/mod_headers.so /usr/lib/httpd/modules/mod_auth_digest.so /usr/lib/httpd/modules/mod_dav.so /usr/lib/httpd/modules/mod_logio.so /usr/lib/httpd/modules/mod_include.so /usr/lib/httpd/modules/mod_autoindex.so /usr/lib/httpd/modules/mod_env.so /usr/lib/httpd/modules/mod_proxy_ftp.so /usr/lib/httpd/modules/mod_negotiation.so /usr/lib/httpd/modules/mod_ldap.so /usr/lib/httpd/modules/mod_status.so /usr/lib/httpd/modules/mod_ext_filter.so /usr/lib/httpd/modules/mod_usertrack.so /usr/lib/httpd/modules/mod_python.so /usr/lib/httpd/modules/mod_proxy_http.so /usr/lib/httpd/modules/mod_userdir.so /usr/lib/httpd/modules/mod_actions.so /usr/lib/httpd/modules/mod_disk_cache.so /usr/lib/httpd/modules/mod_speling.so /usr/lib/httpd/modules/mod_mime_magic.so /usr/lib/httpd/modules/mod_auth_ldap.so /usr/lib/httpd/modules/mod_perl.so /usr/lib/httpd/modules/mod_cgid.so /usr/lib/httpd/modules/mod_dir.so /usr/lib/httpd/modules/mod_rewrite.so /usr/lib/httpd/modules/mod_auth.so /usr/lib/httpd/modules/mod_file_cache.so /usr/lib/httpd/modules/mod_dav_fs.so /usr/lib/httpd/modules/mod_log_forensic.so /usr/local/apache2/modules/libphp5.so /usr/local/apache2/lib/apr-util-1/apr_dbd_pgsql-1.so /usr/local/apache2/lib/apr-util-1/apr_dbd_sqlite3.so /usr/local/apache2/lib/apr-util-1/apr_dbd_pgsql.so /usr/local/php/OLD/php-5.2.8/modules/pgsql.so /usr/local/php/OLD/php-5.2.8/.libs/libphp5.so /usr/local/php/OLD/php-5.2.8/ext/pgsql/.libs/pgsql.so /usr/local/php/php-5.2.9/.libs/libphp5.so /usr/local/php/php-5.2.9/libs/libphp5.so ============ I didn't see any .so file named "php5apache2_2.so", unless you were just making up that filename as an example. Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted August 10, 2009 Share Posted August 10, 2009 I would seriously consider fixing yum, it'll make things allot easier. Anyway, the mod you'll want to load is /usr/local/php/php-5.2.9/libs/libphp5.so Quote Link to comment Share on other sites More sharing options...
RRT Posted August 13, 2009 Author Share Posted August 13, 2009 OK. What does this error mean? There is no text containing "sqlite3ExprDelete" anywhere within the httpd.conf file: # apachectl start httpd: Syntax error on line 57 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/php/php-5.2.9/libs/libphp5.so into server: /usr/local/php/php-5.2.9/libs/libphp5.so: undefined symbol: sqlite3ExprDelete Quote Link to comment Share on other sites More sharing options...
corbin Posted August 13, 2009 Share Posted August 13, 2009 In the context of a library a symbol is essentially a reference to a function (or something else). For some reason it's looking for the sqlite3ExprDelete symbol and can't find it. Unless you compiled/linked your self, I have no idea how in the world that's happening. Actually, I would imagine the PHP library pulls other libraries in dynamically.... Do you have PHP loading the SQLite extension? Quote Link to comment Share on other sites More sharing options...
RRT Posted August 18, 2009 Author Share Posted August 18, 2009 OK, I'm really starting to get irked about his whole PHP configuration issue; I've been working on this problem for over a month. Modifying the httpd.conf and adding LoadModule php5_module "/full/path/to/php/php5apache2_2.so" AddType application/x-httpd-php .php has not informed the server to parse PHP files as PHP. Here's another thing, why are their so many php.ini and httpd.conf files? Shouldn't there just be one of each? Here's the locations I am finding on my server: /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/original/httpd.conf /usr/local/apache2/docs/conf/httpd.conf /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/php.conf /usr/local/lib/php.ini /usr/local/php/php-5.2.9/php.ini /etc/php.ini /etc/php.d/php.ini I just want to get this thing working correctly so I can get the server to parse PHP files as PHP. I need to get past this so that I can move forward onto other things... Thanks! Quote Link to comment Share on other sites More sharing options...
trq Posted August 18, 2009 Share Posted August 18, 2009 Like I said a few posts ago. Fix your yum issue and your problems will be resolved. The reason you would have so many config files lying around is likely because you have tried to compile apache / php on a server that already had them installed by the looks of it. Package managers will usually install into /usr, most people install into /usr/local when they compile. The config files within /etc would be the ones placed there by a package manager, the local ones (/usr/local/*) would be ones placed there when you tried to compile these things. Quote Link to comment Share on other sites More sharing options...
yemao Posted August 18, 2009 Share Posted August 18, 2009 I like use sudo apt-get install php5 Quote Link to comment Share on other sites More sharing options...
trq Posted August 18, 2009 Share Posted August 18, 2009 I like use sudo apt-get install php5 Thats all well and good on a Debian derivative, but the OP is using Fedora. While apt could be installed, he would first need to get yum up and running to do so. Quote Link to comment Share on other sites More sharing options...
RRT Posted August 19, 2009 Author Share Posted August 19, 2009 OK, I am taking your advice and trying to get yum fixed, but keep getting this Python error: ----------------------------------------- yum check-update php5 There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: cannot import name flagToString Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.4.1 (#1, May 16 2005, 15:19:29) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] If you cannot solve this problem yourself, please go to the yum faq at: http://wiki.linux.duke.edu/YumFaq ----------------------------------------- Any ideas as to what I need to do to get this issue fixed? I am running yum version 3.2.23 and Python version 3.1.1. Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted August 19, 2009 Share Posted August 19, 2009 And have you read that FAQ? tried the possible fix mentioned there? Quote Link to comment Share on other sites More sharing options...
RRT Posted August 22, 2009 Author Share Posted August 22, 2009 I tried the solution to Q.7 but it didn't fix it. I tried "python", "import yum" but it fails saying >>> import yum Traceback (most recent call last): File "<stdin>", line 1, in ? File "yum/__init__.py", line 23, in ? import rpm ImportError: No module named rpm >>> Quote Link to comment Share on other sites More sharing options...
trq Posted August 22, 2009 Share Posted August 22, 2009 Seems your install is pretty well fubar, is this a production machine? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.