---
title: "Hur ser jag versionen av PHP?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/94761-hur-ser-jag-versionen-av-php"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "aasah"
published: "2004-01-14T10:10:42.000Z"
updated: "2004-05-15T14:11:34.000Z"
replies: 10
views: 418
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/94761-hur-ser-jag-versionen-av-php"
---

# Hur ser jag versionen av PHP?

## #1 — aasah, 2004-01-14T10:10Z

Hej!

Hur kan jag kolla vilken php-version som används av den server jag kör på? (Eftersom olika versioner hanterar saker på olika sätt?)

Permalänk: https://www.webforum.nu/p/94761

## #2 — SPiN, 2004-01-14T10:12Z

Skapa en fil som innehåller:

```
<?php
echo phpinfo();
?>
```

Kör den. Nu får du ut en massa lull-lull på skärmen, med bl.a. information om vilken version av PHP som körs. :)

Permalänk: https://www.webforum.nu/p/1251887

## #3 — aasah, 2004-01-14T10:31Z

Tusen tack! :D

Permalänk: https://www.webforum.nu/p/1251895

## #4 — aasah, 2004-01-14T11:20Z

Av detta kunde man lära mycket... Vad är skillnaden mellan de "magiska citatinställningarna":

```
[b]Directive            Local Value     Master Value [/b]
magic_quotes_gpc         On               On 
magic_quotes_runtime   Off           Off 
magic_quotes_sybase    Off          Off
```

 
"magic quotes" verkar vara både off och on??? :q
Betyder detta att SQL Injections måste fångas i programkoden eller ej...? Totalt förvirrad...

Permalänk: https://www.webforum.nu/p/1251911

## #5 — aasah, 2004-05-14T08:48Z

Ingen som vet? :q

Permalänk: https://www.webforum.nu/p/1346043

## #6 — Matte, 2004-05-14T12:23Z

magic_quotes_gpc 

magic_quotes på GET, POST och COOKIE.

Från php.ini:

> ; Magic quotes
> ;
> 
> ; Magic quotes for incoming GET/POST/Cookie data.
> magic_quotes_gpc = On
> 
> ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
> magic_quotes_runtime = Off    
> 
> ; Use Sybase-style magic quotes (escape ' with '' instead of \\').
> magic_quotes_sybase = Off

Permalänk: https://www.webforum.nu/p/1346147

## #7 — aasah, 2004-05-14T20:07Z

Ah, tack, Matte! :)

Permalänk: https://www.webforum.nu/p/1346382

## #8 — Qimen, 2004-05-15T13:28Z

Vill du ha ut endast versionsnummer: 

```php
$phpversion = phpversion();
```

Smart om man vill hantera saker beroende på vilken version man har, ex. 

```php
if ($phpversion < '4.0.0') { }
```

Permalänk: https://www.webforum.nu/p/1346612

## #9 — aasah, 2004-05-15T13:48Z

Smart, Quimen! :)

Kan man få ut om magic_quotes_gpc är on eller off också? :q
Med magic_quotes_gpc() eller dylikt? 

Det vore ju verkligen en höjdare...

red: å -\> ä

Permalänk: https://www.webforum.nu/p/1346617

## #10 — Matte, 2004-05-15T14:07Z

```php
if (ini_get('magic_quotes_gpc')) {
   echo "magic_quotes_gpc är satt";
}
```

Permalänk: https://www.webforum.nu/p/1346628

## #11 — aasah, 2004-05-15T14:11Z

Det är bra synd att endast ett svar kan accepteras... :) 

Tack, Matte! :)

Permalänk: https://www.webforum.nu/p/1346630

---

Tråden på webben: https://www.webforum.nu/amne/php/94761-hur-ser-jag-versionen-av-php
