PHP在Ubuntu桌面16.04.02上不起作用 [英] php not working on ubuntu desktop 16.04.02

查看:123
本文介绍了PHP在Ubuntu桌面16.04.02上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要php<然后5.3,因为我继承的软件使用mssql库.

I need php < then 5.3 becouse software I inherited use mssql library.

所以我已经设置了linux和apache(通过localhost或ip可以正常工作),然后:

SO I have set up linux, and apache (working fine via localhost or ip) then:

我在2.9以下的版本中获取libxml(否则会使php无法正常工作-编译器将缺少我相信的一些较旧的库)

I get libxml in version below 2.9 (otherwise make php will not work - compiler will lack some older libraries I belive)

sudo wget ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz #get package
sudo tar -xvf libxml2-2.8.0.tar.gz  #unpack
cd libxml2-2.8.0 #:) rest is quite obvious
sudo ./configure 
sudo make
sudo make install

所以我安装了libxml并以相同的方式使用php

So I have libxml instaled and go with php same way

sudo wget http://museum.php.net/php5/php-5.2.17.tar.gz
sudo tar -xvf php-5.2.17.tar.bz2
cd php-5.2.17
sudo ./configure
sudo make
sudo make install

一切似乎还可以,除了php无法正常工作. Apache不包含它,因此php页面输出看起来完全像这样的代码:

All seems to be ok, except php is not working. Apache doesn't include it so php page output looks exacly same a code like:

both in code and webpage: aaaaaaaaaaaaaaaaaaaaa
<?php
echo "BBBBBBBBB";
?>

到目前为止我发现了什么

What I found so far:

check mods-enabled - I have no php mod at all there

uncomment #LoadModule php5_module libexec/apache2/libphp5.so - I don't have this line at all i apacheconf

run a2enmod php5.2.17 - return "module php5.2.17 doesn't exist"

推荐答案

我终于通过安装ubuntu 14.04解决了我的问题(也许以后我将其更新为16,也许旧的php仍然可以使用),ale然后通过安装1.2.4中的LAMP

I finally resolved my problem by instaling ubuntu 14.04 (maybe later I will update it to 16, and maybe old php will still be working), ale then by instaling LAMP in 1.2.4

可以在这里找到此版本:

This version can be found here: https://community.bitnami.com/t/where-to-find-lamp-stack-running-php-5-2-for-old-software/31209/12

Ubuntu必须为32位!

如何安装.run文件?

How to instal .run file?

sudo chmod +x lamp.1.2-4 
sudo ./some-app.run

在php.ini中还有什么值得更改的地方:

what is worth to change too in php.ini:

error_reporting = E_ALL & ~E_NOTICE 
display_errors = On 
short_open_tag=On

htdocs位于:/opt/lampstack1.2-4/apache2/htdocs php ini可以通过phpinfo()函数轻松找到

htdocs is in: /opt/lampstack1.2-4/apache2/htdocs Php ini is easily find via phpinfo() function

基本操作(在"opt/您的灯泡"目录中:)

basic operations (in opt/your lamp directory:)

sudo ./ctlscript.sh restart apache
sudo ./ctlscript.sh status

替代方法在此处 https://askubuntu.com/questions/597462/how-to-install-php-5-2-x-on-ubuntu-14-04 -我设法做到了所有(提到的补丁链接已损坏),但是在最后的php5模块中,我必须安装最新的5.x php,所以我以我的意愿以5.6.xxx结尾:)

Alternative is here https://askubuntu.com/questions/597462/how-to-install-php-5-2-x-on-ubuntu-14-04 - I managed to do it all (mentioned links to patchs are broken), but in the end php5 module that I had to install newest 5.x php so I ended with 5.6.xxx against my will :)

到目前为止,我无法使mssql正常工作,但是我会为此提出新的问题.

I could not make mssql to work so far, but I will ask new question for this.

希望这对某人有帮助.

这篇关于PHP在Ubuntu桌面16.04.02上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆