473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how do I check against the PHP version?

I'm writing an installation script for my PHP content management
system. I've written the code to be compatible with PHP 4.06 or later.
I need to get the PHP version and throw an error message if the
version is less than 4.0.6. I realize that phpinfo outputs the info,
but what function would get me the version string?
Jul 17 '05 #1
3 1545
lawrence wrote:
I'm writing an installation script for my PHP content management
system. I've written the code to be compatible with PHP 4.06 or later.
I need to get the PHP version and throw an error message if the
version is less than 4.0.6. I realize that phpinfo outputs the info,
but what function would get me the version string?


There's a function called phpversion() and a constant called PHP_VERSION

Refer to http://www.php.net/php_version for more information

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #2
Also see "version_compare" which lets you test if a version is equal to or
greater.

- Kevin

"lawrence" <lk******@geocities.com> wrote in message
news:da**************************@posting.google.c om...
I'm writing an installation script for my PHP content management
system. I've written the code to be compatible with PHP 4.06 or later.
I need to get the PHP version and throw an error message if the
version is less than 4.0.6. I realize that phpinfo outputs the info,
but what function would get me the version string?

Jul 17 '05 #3
Carved in mystic runes upon the very living rock, the last words of
Kevin Lin of comp.lang.php make plain:
"lawrence" <lk******@geocities.com> wrote in message
news:da**************************@posting.google.c om...
I'm writing an installation script for my PHP content management
system. I've written the code to be compatible with PHP 4.06 or
later. I need to get the PHP version and throw an error message if
the version is less than 4.0.6. I realize that phpinfo outputs the
info, but what function would get me the version string?
Also see "version_compare" which lets you test if a version is equal
to or greater.


Of course, that's only good if the installation is 4.1.0 or greater :)
There is a version check function in HoloLib:

ftp://ftp.holotech.net/hololib.zip

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tony | last post by:
On PageA I have: <Input Type="CheckBox" Name="chkBox" Size="1" Value="True" checked> Which works fine! On PageB I have; <%If Request("chkBox")=True Then Response.Write "True" Else
0
by: Todd Brown | last post by:
I've got an application that I had worked on earlier this year that was working fine for customers. Recently, I was asked to make some updates. I didn't have VS installed anymore, so I...
9
by: Sameh Ahmed | last post by:
Hello there Is there a way through dotNet to check if a certain user is a member of a specific group? I use ADSI to get the memberships of the user then compare them to the group I want to check,...
9
by: henrycortezwu | last post by:
Hi all, For example you have 2 text boxes: tbxUsername = Environment.UserName.ToString tbxPassword = ******** How do you check if the password entered by the user matches the same...
6
by: D. Yates | last post by:
Hi, I got bit by the fact that applications using library files that are NOT strongly named will use older versions of the library without generating an error, so........ Is there a way to...
4
by: Stan R. | last post by:
Hello, I have xmllint and xsltproc installed and running on both my linux and win32 platforms, all seems good. I have a couple questions though. 1) If I have an external dtd file, which is...
2
by: rote | last post by:
My sceanrio is this on an asp.net 2.0 freamework. I want to use any of the data controls e.g Gridview,DetailView etc.. But i want some buttons e.g update,edit save etc to be enable or disabled...
173
by: Marty James | last post by:
Howdy, I was reflecting recently on malloc. Obviously, for tiny allocations like 20 bytes to strcpy a filename or something, there's no point putting in a check on the return value of malloc....
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.