Hey there,
I read this post by Beckett
http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=5546&1
and it was informative since it stopped me from wondering if I was dumb, but now that I know I'm dumb I need help getting un-dumb.
As stated in the topic, I used an out of the box Redhat 9 install and then ran the RH Updater and got all of the "latest" patches. Unfortunately, PHP 4.3.1 isn't in those. When I searched on the web, I found out that there is no such thing as an updated PHP RPM, or at least not one written by someone fluent enough in English to inspire any amount of confidence.
I can't help it, I'm a newbie that doesn't want to hand-compile things, rip out Apache and put it somewhere else besides /var/www (the GUI tools for configging name-based virtual servers are great), or reinstall Redhat with another version. I've chosen Redhat 9 and I really like a lot of the new features, but this one flaw sucks.
I realize you folks who maintain gallery are not responsible for this. You guys rock, and you're not on the hook to answer this one, but I've got to ask: What can I do? If I choose to just wait for an RPM of PHP that works with RH9, how long do you think I'll be waiting?
Any help you guys can offer would be great. That being said, it would be cool to get advice that falls within the constraints of (works with RH9), and (works with Apache 2 in the default directories for RH9), and (easy to follow for a newbie). It's a tall order so I guess I'm not expecting much, but I figured I'd just try and ask.
------
Give us your Gallery/webserver information to get a faster answer.
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful):
Gallery version: 1.3.3
Apache version: 2.0
PHP version (don't just say PHP 4, please): 4.2.2
Operating system: RedHat 9
Web browser/version (if applicable):
:???:
Posts: 3474
Okay... on your next coffee break/snack break/whatever... This should take about 20 minutes, 5 of which you actually need to be at the computer for.
PHP is usually *very* easy to compile, and it's designed to be that way, because everybody uses it. If you can run simple shell commands to move between directories, and delete files, then you're all set to compile PHP. No, really! :smile:
Better still, you can always go back and upgrade to future versions via RPM if you prefer.
Here are my "10 steps":
1) Go to http://www.php.net/downloads.php and grab the source code in .tar.gz format. It's up there near the very top.
2) Move to wherever it downloaded to on your computer, and run:
% tar zxvf php-#.#.#.tar.gz
3) Change into the newly created php-#.#.# directory.
4) Then type:
% php -i | grep Configure
That will spit out the configure command that was used to make the version of PHP you have. Make a note of it. (Ignore any HTML tags, if any)
5) Now *you* will run the configure script. I'll give you an example here, but you should use the items that you noted above, so as to match the features you currently have. The example here should be enough :smile:
% ./configure --with-mysql --with--apxs2 --with-gettext --with-mbstring
6) Get that cup of coffee.
7) When the configure is all through, you're ready to compile. ...Better get ready, cause it's a really hard step!: :wink:
% make
:cool: Go back to your coffee, and read the newspaper.
9) When it's done, you'll just install everything. To do this, you must log yourself in as root.
% su
...password
% make install
10) Still as root, restart Apache.
apachectl -k restart
Done! Give it a shot! If it barfs during the compile, then don't worry. Nothing gets affected until you do step 9).
Regards,
-Beckett (
)
Posts: 8194
Beckett, should that not be --with-apxs2 ?
Posts: 4
Beckett,
Very cool instructions, thanks for taking the time to break it down for me. I'm going to try that when I get home tonight.
One more dumb question. How does PHP know the proper place to install itself? If I download it to /home/nightyear and then install it, does PHP figure out that Apache's installed in /var/www or do I need to put the downloaded files there first? Or, better yet, is there a best practice on where to put the downloaded source?
Thanks again for all the help,
nightyear
Posts: 8194
PHP should look in default locations, but if it doesn't, modify the configure line Beckett gave to this (remember to replace --with-apxs with --with-apxs2, as Beckett mistyped; Apache will not work without the "2") :smile:
./configure --with-mysql --with--apxs2=/var/www/bin/apxs --with-gettext --with-mbstring
Posts: 4
*DOH*
With the out of the box install of RedHat9 and Apache, there appears to be no apxs directory. I've run searches on the system and I can't find it. It's definitely not in /usr/local/bin, /var/www, or /etc/httpd.
That being said, I decided to play a bit and just run %./configure. It got much further along than in previous attempts, but still errored out. If I was a smarter and wiser man, I would have written that error code down and taken it to work with me.
I guess the next step might be to remove the RPM for Apache, then download the actual source from Apache.org and figure it out from there. Honestly though, I've devoted more time to trying to fix the shortcomings and oversights of PHP/Redhat9 than it's worth to me. I've only got 2 hours every evening to relax and this is definitely not relaxing to me. At any rate, I've got an extra copy of XP lying around. I'm thinking I may leave linux for another year or two and let it get more robust (read as idiot-proof) and then come back to it. By then someone might have written a "after you install RedHat 9, do this" document.
Beckett, JoyofLinux, Thanks for the time and the help,
nightyear
Posts: 3474
BTW, look for apxs in /usr/local/sbin or /usr/sbin.
Well, at least you're learning lifelong lessons in compiling on Linux. :wink:
Posts: 3
On Redhat 9 you need the httpd-devel package to have the /usr/sbin/apxs directory
Posts: 3
Ok these are the extra RPMs you will need to download to be able to configure php on Redhat 9 using the results from "php -i | grep Configure" if you already have the standard development rpms and standard php and httpd2 RPMs:
libjpeg-devel
httpd-devel
bzip2-devel
libpng-devel
freetype-devel
imap-devel
net-snmp
net-snmp-devel
mysql-devel
postgresql-devel
postgresql-libs
pspell-devel
note: if you find yourself in rpm hell then use "up2date" command to get your packages.
Posts: 3474
Damn. That's a long list.
Posts: 3
I highly suggest going here:
[url]ftp.redhat.com/pub/contrib/libc6/i386[/url]
And downloading the appropriate php rpms you need.
Posts: 26
I ended up getting PHP 4.3.1 since 4.3.2 requires Apache 2.0.44. RH9 only has 2.0.40.
I also had to get curl-devel and libxml2-devel in order to compile.
Posts: 1
Hi There
Thaks to all of you for this thread. I swore at RH9 for a week before i read the FAQ .
Recompile of PHP went almost according to plan (it argued about headers in DB3). Removed DB3 from the ./configure . Restarting apache produced a scoreboard error, so i removed (#) that from httpd.conf.
Nightyear - just follow the instructions. It works !! Compiling is not hard, it just looks sacrey. If it looks scarey it's working. :wink:
Thanks also to all the Gallery team. Your product is just superb.
http://par64.yi.org/gallery
Posts: 18
I went and downloaded the RPM as suggested and tried to install it and here's what I got:
[root@guardian PHP]# rpm -Uv php-4.3.1-1.i386.rpm
error: Failed dependencies:
libdb-3.2.so is needed by php-4.3.1-1
libmm.so.11 is needed by php-4.3.1-1
php = 4.2.2-17 is needed by (installed) php-imap-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-ldap-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-manual-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-mysql-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-snmp-4.2.2-17
Any help you can provide would be great!
I have already downloaded the following RPMs:
php = 4.2.2-17 is needed by (installed) php-imap-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-ldap-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-manual-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-mysql-4.2.2-17
php = 4.2.2-17 is needed by (installed) php-snmp-4.2.2-17
However, the dependencies are where I'm stuck; I could not find them on the download page.
Posts: 18
I need help please, please, please!!! :cry:
More info. Ok, I have either installed or checked to see that the following are both are installed and they are and I still get the same error when trying to install the RPM.
libdb-3.2.so is needed by php-4.3.1-1
libmm.so.11 is needed by php-4.3.1-1
Additionally I have downloaded the source and tried to upgrade PHP that way by following the above instructions and I got the following error when doing the ./configure command:
configure: warning: /php.d: invalid host type
configure: error: can only configure for one host and one target at a time
Here is a copy of my config statement that I got by doing the php -i | grep Configure command:
./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --inc ludedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/va r --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --ca che-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc /php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db3 --with-curl --with-dom=/usr - -with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --e nable-gd-native-ttf --with-ttf --with-gdbm --with-gettext --with-ncurses --with- gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex=system --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe- mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path -- enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --without-oci8 -- with-pear=/usr/share/pear --with-imap=shared --with-imap-ssl --with-kerberos=/usr/ke rberos --with-ldap=shared --with-mysql=shared,/usr --with-pgsql=shared --with-snmp =shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared --en able-memory-limit --enable-bcmath --enable-shmop --enable-versioning --enable-cale ndar --enable-dbx --enable-dio --enable-mcal --enable-force-cgi-redirect
Posts: 3474
it seems you have a space before /php.d which shouldn't be there. I see other odd spaces in there, such as "ke rberos" instead of "kerberos" etc. These sorts of things will cause configure to fail like that.
I think you can probably slim down those configure directives a bit, perhaps. Try just starting off with what I suggested above, and see if that works. If you need specific features later on, you can always recompile.
-Beckett (
)
Posts: 16
I have a question re this,
It might be a little lazy but is it possible to just follow FAQ B3 and install PHP as a CGI? It just seems, for someone as Linux illiterate as me, that it might be the easiest, even if it does leave you with a slightly uglier URL.
Any Feedback re this would be appreciated to prevent me wasting tomorrow evening.
Paul
Posts: 3474
Well maybe. But I mean you still have to compile PHP, right? (Although you could try one of the pre-built CGI binaries, I suppose).
Running PHP as CGI has its own snakepit of problems, so I think your time would be better spent getting the PHP Apache module to compile (this will serve you much better in the long run), unless you can get FAQ B3 up and running in your first attempt.
If you use Google, you'll find tons of helpful guides for compiling PHP for Linux. If you think you can follow my steps on the first page, it's definitely worth a shot, right?
-Beckett (
)
Posts: 16
OK, I decided to do it properly and downloaded the PHP-4.3.1 rpm from Red Hat. I got the following dependency errors
error: Failed dependencies:
libcrypto.so.2 is needed by php-4.3.1-1
libdb-3.2.so is needed by php-4.3.1-1
libmm.so.11 is needed by php-4.3.1-1
libpng.so.2 is needed by php-4.3.1-1
libssl.so.2 is needed by php-4.3.1-1
libstdc++-libc6.2-2.so.3 is needed by php-4.3.1-1
Can anyone tell me which rpm(s) I need to install first to put these in? I looked through the discs and the ftp site but couldn't find them.
thanks
Paul
Posts: 3474
libcrypto.so --> openssl
libdb.so --> glibc (I think)
libmm.so --> mm
libpng.so --> libpng
libssl.so --> openssl
libstdc++-libc.so --> glibc and either gcc or libstdc++
-Beckett (
)
Posts: 8194
According to my system libdb.so is of the package db (notice this is *not* RedHat, but they probably have similar package names).
Posts: 524
check redhats up2date and see what comes up, if anything and see if you cant use that to update with... messing with your glib and gcc libs will break just about everything on your machine if you dont understand whats involved in upgrading those packages.....(be careful!)
Posts: 37
Parcan, could you provide the details of what exactly you did? I have a stock RH9 install with the default apache (2.0.43-21.3) and php (4.2.2-17.2). I downloaded the source for php-4.3.3. I ran php -i | grep Configure and saved the results to a file and striped out the html as well as the db3 requirement - RH9 seems to have the wrong major version. I have installed every relevant devel rpm listed above, as well as unixODBC-devel. When I configure and make it dies in snmp_api.h saying that the headers are out of date, although I can't find a more recent version. Furthermore if I add --with-apxs2=/usr/sbin/apxs to configure, it dies I need apache 2.0.44 or higher.
Seeing another post mentioning the apache version issue I downloaded the source for 4.3.1. db3 doesn't have to disabled for that version, but make dies looking for krb5.h. I have OpenSSL 0.9.7a-5 installed.
Any suggestions?
Posts: 37
I got 4.3.1 compiled and installed.... Adding --with-kerberos=/usr/kerberos and deleteing an extranous --with-snmp=shared did the trick.
Thanks
Posts: 18
I finally figured out how to get PHP 4.3.1 installed from the RPM including all the dependancies. However, Gallery still does not work. I checked what I have installed and it is listed below. Am I missing something???
[root@guardian PHP]# rpm -qa | grep mod
modutils-2.4.22-8
mod_perl-1.99_07-5
usermode-gtk-1.67-2
mod_python-3.0.1-3
usermode-1.67-2
mikmod-3.1.6-20
mod_ssl-2.8.12-2
modutils-devel-2.4.22-8
mod_auth_mysql-1.11-12
[root@guardian PHP]# rpm -qa | grep php
php-devel-4.2.2-17.2
php-manual-4.3.1-1
php-4.3.1-1
php-mysql-4.3.1-1
php-imap-4.3.1-1
php-ldap-4.3.1-1
[root@guardian PHP]# rpm -qa | grep httpd
httpd-manual-2.0.40-21.3
httpd-2.0.40-21
redhat-config-httpd-1.0.1-18
[root@guardian PHP]#
Posts: 8194
Sorry, but "does not work" isn't gonna cut it. What exactly isn't working? Have you restarted apache since the upgrade?
Posts: 18
Restarted Apache - yes
"does not work" details as displayed in browser:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster
Error 500
www.xxx.com
Fri 29 Aug 2003 04:43:59 PM CDT
Apache/2.0.40 (Red Hat Linux)
Posts: 8194
FAQ c.1
Posts: 18
Unfortunately I have this as shown below:
ScriptAlias /album/ "/www/cgi-bin/photo/"
<Directory "/www/cgi-bin/photo">
AllowOverride None
order allow,deny
allow from all
</Directory>
ScriptAlias /album-adm/ "/www/cgi-bin/photo/protected/"
<Directory "/www/cgi-bin/photo/protected/">
AuthType Basic
AuthName "Reserved to the Album Administrator"
AuthUserFile /www/cgi-bin/photo/protected/.htpasswd
require valid-user
</Directory>
<Directory /www/pape/gallery>
AllowOverride Options FileInfo
</Directory>
Posts: 8194
Just go ahead and delete the .htaccess...
Posts: 18
This seems to me that it must be a PHP issue.
I have another PHP web application running on the same computer and it was running just fine before the PHP upgrade and now it is now working either. It uses a .htaccess file for it's login and the log in is working but then it looks like it is just displaying the PHP code, not sure if this will help any. Now I'm not asking to have the other one troubleshot here but I think that the additional info may help resolve the problem. Here's a snipit of what is displayed by the other web app:
#----------------------------------------------------------------
# initialization
#----------------------------------------------------------------
$andromedaPrefsFileName = "andromedaPrefs.php";
function loadConstants () {
global $andromedaConst,$SCRIPT_NAME_FIXED,$SCRIPT_PATH_FIXED,$ckServerIP,$REMOTE_ADDR;
$andromedaConst["andromedaVersion"] = "1.8.5";
$andromedaConst["localUser"] = ($ckServerIP == $REMOTE_ADDR);
$andromedaConst["scriptFileName"] = basename($SCRIPT_NAME_FIXED);
$andromedaConst["scriptPhysicalPath"] = parentFolder($SCRIPT_PATH_FIXED);
$andromedaConst["moduleMode"] = ($andromedaConst["scriptFileName"] == "modules.php");
if ($andromedaConst["moduleMode"]) {
$andromedaConst["scriptPhysicalPath"] .= "/modules/" . basename(dirname(__FILE__));
}
}
Posts: 1
I'm struggling with RH8.0 and this issue. I tried getting the PHP 4.3.1 RPM and installed it successfully but get the "ap_block_alarm" problem when apache tries to load the PHP lib. php -i reveals that it was built --with-apxs not --with-apxs2.
So it is unclear how djsting got it to work... What have I missed?
Anyway, so then I tried the compiling trick. Got 4.3.1 source and all manner of RPMs discussed here, (I also had to get libelf-devel). The make/make install worked fine.
Unfortunately, httpd completely (and silently as far as I can tell) fails.
service httpd start
reports success then I access the server, get nothing and
service httpd status
reprots that "httpd is dead but subsys locked"
Anyone got thoughts on that?
Sidenote: I happened to use up2date httpd. This installed httpd-2.0.40-11.5 and brought along with it glibc-2.3-2-4.80.6. Is this a "bad thing"? The root of my problem? Should I back out of that? Recommendations on how?
Thanks
Posts: 4
Ok everyone... I have finally become too frustrated to bang my head anymore. I have been able to compile a fresh install of PHP 4.3.3, have ran a complete RPM re-install of Apache, and I have even deleted my .htaccess files within the gallery/ directory. I still see the issue where if i try to upload a picture, the background page that exhibits its current status comes back as page cannot be displayed. I am out of ideas. Any thoughts? Anyone?
On a side note, two months ago, I was able to successfully run the gallery application on a Windows 2000 server with IIS 5. no issues... but, that was then, and this is now... now I for some reason cannot get any images to load on my Linux server.... Help....
the URL to your Gallery www.thekilpatrics.com then click on the link to the photo Gallery
the version of Gallery v1.4
the version of PHP, 4.3.3
the version of Apache, 2.0
your operating system and hardware RH 8.0 on an IBM Netfinity Server
(if applicable) the web browser and version you are using,
any debug output or clues that you've already discovered. On home PC, ie 6, on the server, Mozilla 1.0.2FAQ c.20FAQ c.21
Posts: 3473
Change that album so "everybody" can add photos, then we can see the problem for ourselves.
Posts: 4
OK... everybody it is... one other note, if I re-run the good ol' configuration, it still says it isn't obeying my .htaccess file... even after I created a new one....
Posts: 18
Any more thoughts on how to solve my PHP problems?
Posts: 3473
Hmm, no problems here.
Try again and see what happens.
That's probably this bug: http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=84768&group_id=7130&group_project_id=29801
Posts: 4
:lol: Well.. it seems I have found what my issue may be.. if I try to download a "large" picture (more than 500k), the server cannot process the file. I found this by actually paying attention to what the Apache error logs tell me.
So, with that in mind, by adding the lines:
<Directory "/path/to/your/gallery/directory">
AllowOverride Options FileInfo
</Directory>
This should ensure that I am able to "read" my .htaccess file, and therefor, should be able to upload large images. Correct? Is this the same command I give to Apache if I am running 2.0?FAQ c.21
Posts: 1
hi,
I have a fedora 4 server with php 5.0.4. How can I find out where Redhat installed PHP? thanks. jen.