更新到php7.1会返回echo代码页而不是布局

时间:2017-04-28 14:45:20

标签: php cakephp codeanywhere

enter image description here

我正在使用cakePhp并且必须新安装一切。在我更新之前一切都工作正常,但后来我从回购中取出它说我需要7,所以我更新了,现在得到这个。

cake和phpinfo说的相同

enter image description here

然后如果我尝试将地址从/更改为/ phpmyadmin - 这些是我得到的变种

public class MainActivity extends AppCompatActivity {
    private TextView screen;
    private String str2, result, str, sign;
    private double a, b;
 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        screen = (TextView) findViewById(R.id.textview);
        str = "";
    }

    public void onclick(View v) {
        Button button = (Button) v;
        str += button.getText().toString();
        screen.setText(str);
        a = BengaliUtils.toDouble(str);
    }
    public void onclicksign(View v) {
        Button button = (Button) v;
        sign = button.getText().toString();
        screen.setText(sign);
        str = "";
    }
    public void calculate(View v) {
        Button button = (Button) v;

        str2 = screen.getText().toString();
        b = BengaliUtils.toDouble(str2);
        if (sign.equals("+")) {
            result = a + b + "";
        } else if (sign.equals("-")) {
            result = a - b + "";
        } else if (sign.equals("*")) {
            result = a * b + "";
        } else if (sign.equals("/")) {
            result = a / b + "";
        } else {
            screen.setText("?????? ???");
        }
        {
            screen.setText(BengaliUtils.toString(result));

        }
    }
}

class BengaliUtils {
    static String toString(double value) {
        //TODO implement logic
        // You can convert value to regular number text, and then replace each char with the Bengali version. The performance could be improved with better logic.
        return text;
    }

    static double toDouble(String text) {
        //TODO implement logic
        //You can do that, first replace each Bengali char with normal number char. The use Double.parse on new text. The performance could be improved with better logic.
        return value;
    }
}

require dirname(__DIR__) . '/config/bootstrap.php';

use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Routing\DispatcherFactory;

$dispatcher = DispatcherFactory::create();
$dispatcher->dispatch(
    Request::createFromGlobals(),
    new Response()
);

1 个答案:

答案 0 :(得分:0)

您可能需要禁用apache正在使用的旧版本的php并启用新mod。检查/etc/apache2/mods-enabled的内容。您应该看到php7.1.confphp7.1.load。如果没有尝试使用sudo a2enmod php7.1sudo service apache2 restart启用它们。

还要确保禁用旧的mod。如果你从php 5升级,你将使用sudo a2dismod php5然后重启apache。