# PHP messed up



## orryun (Sep 2, 2010)

Hi,
I've tried to upgrade my 5.2.14 php to the new 5.3..

I used /usr/ports/lang/php5 and then `make install clean`... 

After I restarted the Apache, many php errors came up, such as unknown "start_session()" function.. I tried to reinstall the php5-extensions, but I end up getting:


```
Stop in /usr/ports/sysutils/pecl-fileinfo.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1
```

... Anyone experienced that kind of problem ?


----------



## SirDice (Sep 2, 2010)

From /usr/ports/UPDATING:


> 20100409:
> AFFECTS: users of lang/php5
> AUTHOR: ale@FreeBSD.org
> 
> ...


----------



## gilinko (Sep 2, 2010)

Did you read the instructions in /usr/ports/UPDATING? If not, you should do that on a regular basis.

And searching the forum gives about 10 pages of information on PHP, and half of them deal with upgrading from 5.2 -> 5.3. The most relevant can be found here: http://forums.freebsd.org/showthread.php?t=13149


----------



## SirDice (Sep 2, 2010)

Yes, you should make a habit of reading UPDATING _before_ actually starting to update something. 
If there are special instructions, or just the order, that are important they'll be noted there.


----------



## orryun (Sep 3, 2010)

I did all of those things.. 
I deinstalled php52 and the other extensions such as spl and etc..

Now I tried to install php5 using lang/php5.. the installation didn't give any errors, but php doesnt seem to be installed.. (When I run "php index.php", I get No such file or directory)


----------



## DutchDaemon (Sep 3, 2010)

Did you (re)install the Apache module?


----------



## orryun (Sep 3, 2010)

No.. could you please show me how? 
I'm just really new to FreeBSD and any tips/how-to's/tutorials would help me..


----------



## SirDice (Sep 3, 2010)

Did you install php5 using a package or the port? The package doesn't contain the apache module. And the port has it turned off by default.


----------



## DutchDaemon (Sep 3, 2010)

[cmd=]cd /usr/ports/lang/php5[/cmd]
[cmd=]make config[/cmd]


```
[ ] APACHE     Build Apache module
       ^
       |
```


----------



## orryun (Sep 3, 2010)

SirDice-
I installed php5 using the `cd /usr/port/lang/php5/ ; make install clean`. I checked the apache module..

DutchDaemon-
I've already checked it


----------



## SirDice (Sep 3, 2010)

After you've installed something you may need to run *rehash* for the shell to pick up the new executables.


----------



## DutchDaemon (Sep 3, 2010)

`httpd -M | grep php5` ?


----------



## orryun (Sep 3, 2010)

SirDice-

```
-bash: rehash: command not found
```

DutchDaemon- 

```
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 authn_file_module (shared)
 authn_anon_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_default_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 file_cache_module (shared)
 cache_module (shared)
 disk_cache_module (shared)
 include_module (shared)
 filter_module (shared)
 charset_lite_module (shared)
 deflate_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 mime_magic_module (shared)
 cern_meta_module (shared)
 expires_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 unique_id_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 asis_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 imagemap_module (shared)
 actions_module (shared)
 userdir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 php5_module (shared)
 python_module (shared)
 dav_svn_module (shared)
 authz_svn_module (shared)
Syntax OK
```


----------



## DutchDaemon (Sep 7, 2010)

Is the php5 module activated in httpd.conf?


----------

