I recently updated my linux mint via the automatic updater. I had the problem, that it did not execute php scripts. After re-installing libapache-mod-php5 some php started to work. Yes, just some, as phpinfo() is executing properly, but another php file, which works correctly on other machines, and was working on mine too, is now producing the following error in resopnse to an $.ajax call: status: parsererror errSyntaxError: Unexpected token <. what happens is it returns the php file without executing it, even though it executes other php files.
My configs are the following:
Server version: Apache/2.4.6 (Ubuntu)
PHP 5.5.1-1~precise+1 (cli) (built: Jul 22 2013 07:33:14)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.2-dev, Copyright (c) 1999-2013, by Zend Technologies
The problem was that after the update the php.ini got overwritten and it was not interpreting shortcode. The solution is to set
short_open_tag=On
in the php.ini as suggested here.
Related
I am using WSL for PHP development. Since one day, every time I changed my source code and checked on the local address, the change didn't apply until I restart the apache.
I googled about it for a while, nothing came up with this problem.
I reinstalled the PHP and apache2 but nothing changed.
Which file should I look for this problem?
Please could anyone guess what causes this problem?
Below are my PHP version and apache information.
$ php -v
PHP Warning: Module 'exif' already loaded in Unknown on line 0
PHP Warning: Module 'mbstring' already loaded in Unknown on line 0
PHP 7.2.24-0ubuntu0.18.04.6 (cli) (built: May 26 2020 13:09:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.6, Copyright (c) 1999-2018, by Zend Technologies
$ apache2 -v
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2020-08-12T21:33:25
I've found out the WSL version was 1, so I made it upgrade to WSL2.
The problem solved.
I have been trying to upgrade the current version of PHP (7.0.2) to 7.3.
I have tried this method here which helped me install v7.3, but it does not get activated.
Here's what else I tried:
I stopped and started VM Instance
I restarted apache2
Tried locating app.yaml to modify the PHP runtime specified here, but couldn't find it.
I tried reinstalling apache since it was giving some error
But none of these helped. I also read here that it's not possible without migrating to a new instance, which truly is a pain and I would want to avoid that at all costs.
Now sure what I should share so here are some stuff:
This is what I get for php -v
$ php -v
PHP 7.0.27 (cli) (built: Jan 19 2018 12:12:50) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27, Copyright (c) 1999-2017, by Zend Technologies
Am I missing out on something very obvious?
I am not much of a coder, so be gentle :P
In your app.yaml add:
runtime: php73
GCP - PHP 7 Runtime Environment
I'm using XAMPP version v3.2.1 and here's the output of php -v:
PHP 5.4.19 (cli) (built: Aug 21 2013 01:12:03)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
I want to set up Zero-Configuration Debugging with PhpStorm, so I followed all the steps (I think) and tried to launch a PHP file with breakpoints placed on it. But for some reason, when I open / refresh the page, it doesn't detect the breakpoint at all, nor it shows the incoming connection screen in PhpStorm.
I validated my setup here:
and I'm using https://github.com/BrianGilbert/xdebug-helper-for-firefox Firefox plugin.
I just want to simply debug my local PHP website as I browse through it, what am I doing wrong?
You are using PHP 5.4. Please, for the love of god, upgrade. This, and Xdebug's 2.2, haven't been supported for half a decade. Neither PHP 5.4 or Xdebug 2.2 are supported any more, and not for a very long time.
I want to utilize PHP's get_browser() function, so I have included browscap = extras/lite_php_browscap.ini in my php.ini file.
I am running:
PHP 7.0.15 (cli) (built: Jan 17 2017 13:44:27) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15, Copyright (c) 1999-2017, by Zend Technologies
My website still works, and get_browser() is working great... but when I go do a composer update, I am getting a big red zend_mm_heap corrupted error message.
I've tried setting opcache.fast_shutdown=0, and even turning off opcache altogether, and that doesn't fix it.
The weird thing is, I have this same setup up on my dev server, and it works fine. The only difference I can see is that I'm running PHP 7.0.18 there.
Any ideas why this is happening, and how I can try to avoid it? Thanks!
I have a situation in the office. For development, i have been using the built-in web server that comes with PHP 5.4.
My problem is, on my local machine, it works like a charm but on the staging server, request uri length becomes a problem.
Staging server is: Ubuntu 12.10 32 bit.
PHP Version is
PHP 5.4.14-1~quantal+1 (cli) (built: Apr 11 2013 16:59:23)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
php.ini files are the same with the ones in my local.
I tried to recompile the PHP but still no luck. I have a simple php code to test as;
<?php
echo $_GET['q'];
?>
but when the request is too big (around 1447 chars like index.php?q=blahblah...) Built-in web server fails and just gets ....endofstring as request. So returns a 404.
I Know that every web server has a request url length limit, but while an identical request to my localhost (ubuntu 12.04, again php built-in server) works, there should be something that i miss.
Any suggestions or clues where to look for the problem?