New answers tagged

0

/usr/lib/php5/sessionclean: 12: /usr/lib/php5/sessionclean: php5: not found I just updated php on my debian and had the same error. Check if you fully deleted php5, I had to manually uninstall package php5-common. (Package php5 was however uninstalled automatically by dist-upgrade)


0

Im my case not only the php wasn't working but phpmyadmin aswell i did step by step like that sudo apt install php libapache2-mod-php sudo apt install php7.0-mbstring sudo a2dismod mpm_event sudo a2enmod mpm_prefork service apache2 restart And then to: gksu gedit /etc/apache2/apache2.conf In the last line I do add Include /etc/phpmyadmin/apache.conf ...


0

I have made a tutorial on youtube how to make it right....with all the things you need to work with laravel. Here is the link... https://www.youtube.com/watch?v=A6TdaRIsG6g Sorry if this is against the rules but i don't have enough reputation points to just make a comment, so i posted this as an answer


0

So I had the same problem as the above guy where I needed to install php-dom so i tried to run apt-get install php-dom but the it just came up with the message Package php-dom is a virtual package provided by: php5.5-xml 5.5.35-1+donate.sury.org~xenial+2 php7.0-xml 7.0.6-1+donate.sury.org~xenial+1 php5.6-xml 5.6.21-1+donate.sury.org~xenial+2 You should ...


0

https://wiki.archlinux.org/index.php/Apache_HTTP_Server sudo a2dismod mpm_event sudo a2enmod mpm_prefork service apache2 restart Note: The above is required, because libphp7.so included with php-apache does not work with mod_mpm_event, but will only work mod_mpm_prefork instead. (FS#39218) Otherwise you will get the following error: Apache is running ...


0

As for any PHP file, opening the source file in the browser will show a mix of rendered HTML and non-interpreted PHP code (or depending on the PHP code even the full source or nothing): you would get the same result by opening the file from the GUI. You need to request the page to the server, i.e. in your case localhost: google-chrome ...


0

If you installed phpymadmin from the archives, php-gettext is a dependency and would be automatically installed.


1

You have an error in php-fpm.conf as stated in the logs you posted (stripped timestamps): ERROR: [/etc/php/7.0/fpm/php-fpm.conf:127] value is NULL for a ZEND_INI_PAR PHP: syntax error, unexpected '$' in Unknown on line 1 ERROR: failed to load configuration file '/etc/php/7.0/fpm/php-fpm.conf' ERROR: FPM initialization failed Fix your php-fpm.conf and run ...


1

The package you need is libapache2-mod-php7.0. This will install the PHP module and dependencies for it into Apache and your system. Make sure you have the latest repository data too (sudo apt-get update in the terminal) and any relevant security updates.


1

Ubuntu 16.04 includes PHP 7.0 that doesn't have old MySQL extension anymore as it has been deprecated for some time and removed in PHP 7.0. You either need to update your application to support MySQLi or pdo_mysql or install PHP 5.6 from PPA (ppa:ondrej/php).


0

The problem is you no longer have PHP 5 and are running PHP7 .. You may need to update some PHP plugins and files for the new PHP7. php.ini's are now located at /etc/php/7.0 not /etc/php5 .. You may need to change things in apache or moodle to reflect this change


4

No job and no customer is worth running PHP 4 unless they pay you a huge amount of money as running PHP 4 imposes a great security risk and in that case you won't be asking here. Isolate PHP 4 installation as much as you can and put it in the separate segment of the network preferably behind some web proxy where you can sanitize the requests coming from ...


0

Option 4 -- Fully automated transition This is like Option 3, but adds dummy packages that will replace the old php5* and pull the new php5.6* Pros (includes Pros from Option 3): If everything works like expected, it might be the best option, as the users will have the new packages without any work at their side Cons (includes Cons from Option 3): ...


1

Option 3 -- Automatically add the new PPA This is like 2, but php5-common would automatically add the new PPA, so the new packages would be available after next apt-get update run. Optionally there could be a Debconf question whether the users wants the PPA added automatically or they will do so themselves. Pros: One single repository to handle No ...


0

Option 2 -- Make a deprecation plan and inform the users prominently Pros: One single repository to handle No automatic transition Users can prepare their transition plan Cons: Some users will miss the announcement no matter how hard you try There will be people how will say: "Please, don't do that" No automatic transition


0

Option 1 -- Do nothing Pros: Users are happy Cons: Every duplicate source package has to have two versions of the build script Overloaded and unhappy PPA maintainer


0

Ubuntu 16.04 comes with php 7.0, and some php applications might still fail with php 7.0 .Therefore, in some cases, it might be sensible to have both php 7.0 and php 5.x, so that you can choose which version to use for your needs at any time. You can do so with: xavi@computer# sudo su root@computer# add-apt-repository ppa:ondrej/php root@computer# apt-get ...


0

oerdnj 's solution works, after installing mbstring you should enable it in php.ini before run composer install. In my case laravel requires ext-mbstring and ext-dom: apt-get install php-dom


0

To do it from the terminal: sudo mkdir /var/www/html/YOUR_DIRECTORY_NAME


0

sudo chown -R $USER:$USER /var/www/html


0

Got it. It was because httpd.conf was unable to load libphp5.so LoadModule php5_module libexec/apache2/libphp5.so If I comment this. Apache starts working. But it should've logged in the errors. Don't know why it didn't log any error. Anyways thanks @FlorianDeish for the help.


0

At this stage I would simply recommend "turning it off and on again" by doing: sudo apt-get purge php-common php5-common followed by sudo rm -r /etc/php And then reinstalling PHP 7.0 and mysql modules: sudo apt-get install libapache2-mod-php php-mysql You may also try just purging and reinstalling mysql modules, first removing the package: sudo ...


4

Ubuntu 16.04 comes with PHP 7.0 packaged with php7.0- prefix. PHP CLI SAPI is packaged in php7.0-cli package and provides /usr/bin/php command symlinked to /usr/bin/php7.0 binary using update-alternatives mechanism to provide best available PHP version. If you need PHP 5.6 or PHP 5.5 CLI you need to use ppa:ondrej/php and install either php5.6-cli or ...


0

Use the -f instead of the -c switch to specify a config file, like httpd -t -f httpd.conf Make sure httpd.conf is the the current directory.


1

If the OOM killer is being invoked, it means your system's physical RAM and swap are both full. No amount of tinkering with /proc or php.ini will fix this. You've got three options: Increase the size of the swap space. Install more RAM. Re-write your program to be more memory-efficient.


1

PHP mbstring extension now resides in a separate package, so you need to do: apt-get install php-mbstring


1

This functionality is available by enabling the Apache userdir module with: sudo a2enmod userdir Your next step is to configure how you want Apache to handle the URIs. Some examples: If you want the URL http://localhost/~user1/site1 to load from the /home/user1/site1 directory, you need to use UserDir ./ If you want the URL ...


-1

You can define virtualhost with different servername and document root for each people. But you should edit /etc/hosts for each user . For example : Virtualhost *:80 Servername : person 1 Document root : /home/person1 And also you can define home directory as document root and each user can find his/her directory. Notice that you should give www-data ...


2

The new package is php7.0-cgi. php5 is being replaced with 7.0. I would strongly installing the newest version. sudo apt-get install php7.0-cgi However I would recommend installing php-cgi meta package that depend on php7.0-cli for Ubuntu 16.04 to ensure you will always get latest PHP version on upgrades: sudo apt-get install php-cgi


1

Yes php5 has completely been removed from 16.04 LTS and uses php7.0 but you can fix that easily by : sudo apt-get install php7.0-cgi


1

In order to solve my issues, I needed to purge php7 from my server, remove the ondrej repo, and install everything from the Ubuntu repos. My Steps: apt-get --purge remove php7* rm -f /etc/apt/sources.list.d/ondrej* apt-get update && apt-get -y upgrade #just for safeties sake apt-get -y install php7.0-fpm php7.0-curl php7.0-gd php7.0-intl ...


0

Usually this is an issue after a vanilla install in 16.04 (Xenial Xerus) too. To fix it: sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf sudo a2enconf phpmyadmin.conf sudo systemctl restart apache


0

The ppa:ondrej/php provides PHP packages only for latest two LTS release and only for supported releases and usually a current development release after some reasonable time. At the time (April 2016) of writing this, the list includes: Ubuntu 14.04 LTS (trusty) Ubuntu 15.10 (wily) (EOL July 2016) Ubuntu 16.04 LTS (xenial) When you open the PPA in the ...


1

install libapache2-mod-php and worked for me


1

PHP has a setting that limits how much memory a single script can use. It doesn't matter how much total RAM your system has if you exceed that value. If you're running at the console, the file that affects it is likely /etc/php5/cli/php.ini and has a line that reads: memory_limit = XXXXXXX To remove the limit entirely, change it to read: memory_limit = ...


0

Ubuntu 16.04 removed php5 packages and removed those with PHP 7.0 packages that doesn't have php5, but just php inside package names, so replace your command with: sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-intl php-pear php-imagick php-imap php-mcrypt php-memcache php-ming php-ps php-pspell php-recode php-sqlite php-tidy ...


1

You have two options ENTER THESE COMMANDS FOR THE SPECIFIC ERROR IF YOUR PRIOR CONFIGURATION IS OKAY sudo apt-get install php-gettext sudo apt-get install php-mbstring sudo apt-get update sudo service apache2 restart OR REMOVE AND START A FRESH INSTALL sudo service mysql stop sudo apt-get --purge remove mysql* sudo apt-get --purge remove phpmyadmin sudo ...


0

PHP7.0 is standard on Ubuntu 16+ Heres the rundown: 1 As Always sudo apt-get update 2 Install Apache2 sudo apt-get install apache2 3 Install mysql-server sudo apt-get install mysql-server 4 Install PHP 7.0 sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php-mbstring php7.0-mbstring php-gettext php7.0-json php-xml ...


0

Finally, I've found an answer by myself. Ondrej's has an experimental repository which contains PHP 7.0.6RC version.


1

I don't have a high enough reputation to add a comment, but I thought I would share in an aswer my current experience. I am a web developer. I have been using ubuntu for many years and am comfortable with apt-get and a little configuration. I bought my Aquaris M10 with the purpose of using it as a travel computer. The idea is that it would be handy to use ...


0

There is problem with owncloud repos not supporting Ubuntu 16.04 yet. As a workaround you can manually download *.deb files for 15.10. But that's not very nice solution.


0

For me, this problem seemed to occur due to one or a combination of: Compression on the SSH session An SSH tunnel running at the same time Most likely the SSH tunnel - I was tunneling X to allow access to a web browser. I think this perhaps in combination with the compression was causing the session to lock up.


0

ok so finally this worked out: http://stackoverflow.com/questions/30285453/error-installing-php5-mcrypt sudo add-apt-repository -r ppa:ondrej/php5 sudo add-apt-repository -r ppa:ondrej/php5-oldstable sudo add-apt-repository -r ppa:ondrej/php5-5.6 sudo apt-get purge php5* apache2* mcrypt* sudo apt-get update sudo apt-get upgrade sudo apt-get install php5 ...


0

These errors are usually (without apt-cache policy on missing packages it's hard to say) manifestation of: Not using the PPA at all, check whether /etc/apt/sources.list.d/ contains the ondrej-php5-5_6-trusty.list file and it's not empty or commented out. If the file doesn't exist, you should add it back using: sudo add-apt-repository ppa:ondrej/php5-5.6 ...


12

What worked for me was this guide: http://www.lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu Actually is not required to remove php7.0, you can install php5.6 together ( also because you will have dependency problem with phpmyadmin package that required php7.0) Assuming libapache2-mod-php is a suitable way to enable PHP in Apache for you, you can ...


1

Ubuntu 16.04 comes with PHP 7.0. You need to install libapache2-mod-php package and then disable all traces of PHP5. Uninstall PHP5.x package: sudo apt-get purge php5-common (this will remove all PHP 5 packages. Install default (7.0) PHP apache2 SAPI: sudo apt-get install libapache2-mod-php If the apache2 is still broken do: sudo rm ...


4

The php command is provided by php7.0-cli package on Ubuntu 16.04. Running the CLI is orthogonal to the web server configuration. You need to install and configure one of the web SAPIs - apache2, fpm or cgi. The most easy is to install apache2 SAPI. To install apache2 SAPI, run apt-get install libapache2-mod-php (this will pull the default PHP version, ...


3

Your question lacks important details, so I will answer more broadly. Assuming you are using packages, there are some important details: Apache2 can be configured to use either apache2 SAPI using libapache2-mod-php7.0 package or FPM SAPI using php7.0-fpm with mod_proxy_fcgi. Ubuntu 16.04 has only PHP 7.0 in the repositories, you can use ppa:ondrej/php to ...


1

I think you should remove your php packages and install php5.6. You can proceed as follows: sudo aptitude purge dpkg -l | grep php| awk '{print $2}' |tr "\n" " " sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php5.6 You can then check the version of your php to be sure. It is done as seen below: php -v


0

I made mine running again by installing libapache2-mod-php7.0. Hope this helps.



Top 50 recent answers are included