I recently switched to a new Ubuntu 16.04 web server (on GCE) from an Ubuntu 14.04 server. I moved across a few Ruby on Rails projects that run on nginx and postgres with few problems. I now have two legacy CakePHP 1.3 apps to move over to the new server, but I am running in to PHP and MYSQL problems.
The old server was Ubuntu 14.04 running PHP 5.5 and MySQL 5.5.
Ubuntu 16 runs PHP 7, but since I read that CakePHP 1.3 won't work on PHP7, I have downgraded to PHP 5.6.
But, I am still getting this error "PHP message: PHP Fatal error: Call to undefined function mysql_query()"
Is this because I am running mysql-5.7? Or is it still a problem with my PHP 5.6 installation?
I can get phpinfo to run. Here is a screenshot of the top of the result.
Somewhere along the way of downgrading PHP from PHP 7 to PHP 5.6 I missed a few php5.6 packages. I did the following:
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
sudo service nginx restart
Now the old cakephp1.3 site is working fine on Ubuntu 16.
Also, note that since I am running CakePHP through nginx instead of the standard Apache setup, I needed to customize my nginx configuration specifically for CakePHP.
Related
I have a web server running on virtual machine Debian 10 (Buster)
I need to upgrade the PHP 7.0.33 to PHP 7.1 or higher, and as you know, debian buster already has PHP 7.3 ready to be installed.
the problem is when i try to sudo apt-get install php7.3-cli or any other php extension it asks me to remove local custome packages which are essential for the web server becase they depends on the old php version.
I tried to do sudo apt-mark hold <custom_package>, but it is still asking me to remove them and preventing me from upgrading/installing the new php version.
How to fix this issue?
Am i doing something wrong?
the reason for upgrading the php is that the upgraded version of web server content requires php version to be 7.1 or higher, i even tried to neglect this platform check, the web server worked but with issues which make the server unfuntional.
Sorry, i'm new to this and just trying to resolve the problem.
Regards,
I am running a laravel 5.7 app on apache server which i have tried on the different php versions(7.2, 7.3) i have installed on my ubuntu system. Upon hitting the apps url in the browser i get this error Class 'MongoDB\Driver\Manager' not found
I have been battling with this for a while now and have tried so many solutions out there but it still persists. I have mongodb extension installed on all the php distributions.
Funny enough, When i tried getting a record from the db using tinker it works very fine.
You must install php extension separatly; is not a library
https://www.php.net/manual/en/mongodb.installation.manual.php
In ubuntu simple run
sudo apt-get install php-mongodb
Not sure why this isn't working in c9... but
It's really strange because i have installed php5-curl, but i do have php7.0.9, is there a php7-curl?
I have tried apt-get php-curl, php7-curl, php7.0-curl.... and none of them work.
All I get is:
E: Unable to locate package php70-curl
for all of them.
I also updated apt-get.....
SO am i missing something?
PHP 5 extensions do not work with PHP 7. As far as I know, if you compile PHP 7 with --with-curl in the configure command, it will just compile it in.
Are you running Ubuntu? If you are, then are you running 16.04 or newer? In 16.04, there's a package called php7.0-curl in the Ubuntu repositories. http://packages.ubuntu.com/xenial/php7.0-curl
If you are on Ubuntu and on a release earlier than 16.04, I would suggest upgrading. If you are not on Ubuntu, then which distribution are you on?
EDIT: After creating an account on Cloud9, I found that the PHP template is running Ubuntu 14.04 with PHP 5.5. Did you change this?
I'm on Ubuntu 12.04 64 bit, I decided to upgrade to PHP 5.5 from 5.3 and apache2 2.2 to 2.4. I did something similar to Installing apache 2.4 and php 5.5 on ubuntu 12.04. Long story short something's broken and it's not working correctly so I want to go back to PHP 5.3 and apache2 2.2.
Is it just a case of uninstalling PHP and Apache, removing the sources I added, do a package update and then reinstalling PHP and Apache using apt? I just want to go back to a version of PHP and Apache that work correctly and are supported by 12.04.
Thanks.
Remove the files in /etc/apt/sources.list.d/ that matches the ppa names you added. You should find one like ondrej
Run then sudo apt-get update && sudo apt-get install php5 apache2 and you should have all back working
I've used ondrej ppa too (There are apache 2.4 and mysql 5.6 too from the same author which works really well for me, https://launchpad.net/~ondrej)
I'm running on php 5.2.6 on my development server and need to install phpMyAdmin. However, when I install phpMyAdmin, it updates my php to 5.3.x and that causes my website to break... Been looking online but haven't found anything that will install phpMyAdmin but leave alone the php version.
Anyone know how to install phpMyAdmin without upgrading php automatically? Leave php version alone, just install the phpMyAdmin on Linux Fedora 14.
You can just download it from here. Don't use yum to install this package.