Closed alessiodionisi closed 8 years ago
Great job @alessiodionisi , thanks!
I'm not sure, but shouldn't the package name in .desc
file be php7.0-fpm
instead of php-fpm7.0
in this line ?
Mmm yes!
wonderful!!
:+1:
I am all new to Ajenti, but is there a way to import this plugin right away? Taken that it is a plugin, and not changes to the actual code.
@JapSeyz your system is Ubuntu?
@alessiodionisi Yes
@alessiodionisi: Could you please provide some guidance on how to get this running on Ubuntu? Thanks.
If you really need this patch, then for the time being after upgrading php, you can run
cd /var/lib/ajenti/plugins/
curl https://patch-diff.githubusercontent.com/raw/Eugeny/ajenti-v/pull/213.patch | sudo git apply
It can be reverted later by appending --reverse
Next comes restarting ajenti and in websites interface you should have available PHP7.0 FastCGI as new content provider, restart nginx and it should just work (or so from my memory).
PS. ppa:ondrej/php-7.0 is now deprecated in favour of co-installable PHP 5.6 + 7.0 version ppa:ondrej/php
Install add-apt-repository requisites
apt-get install software-properties-common
Add ppa:ondrej/php repository
add-apt-repository ppa:ondrej/php
apt-get update
Purge old php5 and ajenti-v-php-fpm
apt-get purge ajenti-v-php-fpm
apt-get purge php5-*
apt-get autoremove
Install php5.6 & php7.0
apt-get install php5.6-fpm php5.6-mysql php7.0-fpm php7.0-mysql
Apply my new patched files and enjoy php5.6 & php7.0!
Like I said here for another "on-the-edge" request : https://github.com/Eugeny/ajenti-v/issues/188
It's never a good idea to push the early "non-stable" version to a stable product. Your work based on a non official repository you have to add by using the add-apt-repository.
Why did you not just wait until Ubuntu / Debian and other distributions push it on a stable state ?
Because the config path could be change in the stable repository to have a unique php-fpm folder and not the crappy php7.0-fpm we have here.
And moreover if the new stuff break the existing, it's not worth it.
So yeah, your stuff breaks ajenti-v and I push a fix here : https://github.com/Eugeny/ajenti-v/pull/219
No need to rollback, the bad is already in place.
@Xefir
Debian already pushed the PHP7 and it's usable, is it not stable?
@Xefir Sorry for indentation error caused by GitHub editor. My work add two new plugins and does not break anything. You can use original ajenti-v-php-fpm or one of my plugins with the unofficial (but complete) ondrej/php repository.
Sorry for my angryness and frustration, it doesn't really help me to go further.
I look on your code and yeah, in theory, it breaks nothing.
And thanks for the debian hint, the last time I check, it was only on the unstable branch (witch could have some huge changes before merge) and not on the testing branch (witch is the branch that will became stable when it was time, so pretty "stable" I guess).
I don't have the time to test php7 yet, I will check later :)
@alessiodionisi
When I want to upgrade from PHP5 to PHP7, should these steps be sufficient ? Are there going to be any losses ?
@Ardakilic These steps are fine! New plugins does not understand old configurations, copy them somewhere :)
@alessiodionisi For these two plugins can not merged with original Plugins inside?
@Flandoll download a zip of this repository and extract vh-php5.6-fpm
and/or vh-php7.0-fpm
on /var/lib/ajenti/plugins/
@alessiodionisi I am referring to modify the original plugin code rather than by adding Plugins
OK, I've tried but it doesn't create pools, so websites aren't accessible. Any ideas ?
Also, when you create the PHP7.0-FastCGI, matching pattern is just /, nothing is filled.
This is the nginx log:
2016/01/27 11:20:06 [crit] 24661#24661: *928 connect() to unix:/var/run/ajenti-v-php-fcgi-sitecom-php-fcgi-0.sock failed (2: No such file or directory) while connecting to upstream, client: 1.2.3.4, server: site.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/ajenti-v-php-fcgi-sitecom-php-fcgi-0.sock:", host: "www.site.com", referrer: "http://www.site.com/"
Please check the logs
Working examples: http://php7.alessiodionisi.com/ http://php5.alessiodionisi.com/
Please see my updated edits.
You have /var/lib/ajenti/plugins/vh/layout/main-backend-params-php5.6-fcgi.xml
and /var/lib/ajenti/plugins/vh/layout/main-backend-params-php7.0-fcgi.xml
?
Yup, I have both:
ā layout pwd
/var/lib/ajenti/plugins/vh/layout
ā layout ll
total 68K
-rw-rw-r-- 1 1000 1000 1.9K Jan 27 05:41 ext-processes.xml
-rw-rw-r-- 1 1000 1000 192 Jan 27 05:41 main-backend-params-fcgi.xml
-rw-rw-r-- 1 1000 1000 479 Jan 27 05:41 main-backend-params-nodejs.xml
-rw-rw-r-- 1 1000 1000 1.4K Jan 27 05:41 main-backend-params-php-fcgi.xml
-rw-rw-r-- 1 1000 1000 1.4K Jan 27 05:41 main-backend-params-php5.6-fcgi.xml
-rw-rw-r-- 1 1000 1000 1.4K Jan 27 05:41 main-backend-params-php7.0-fcgi.xml
-rw-rw-r-- 1 1000 1000 184 Jan 27 05:41 main-backend-params-proxy.xml
-rw-rw-r-- 1 1000 1000 1.1K Jan 27 05:41 main-backend-params-python-wsgi.xml
-rw-rw-r-- 1 1000 1000 845 Jan 27 05:41 main-backend-params-ruby-puma.xml
-rw-rw-r-- 1 1000 1000 208 Jan 27 05:41 main-backend-params-ruby-unicorn.xml
-rw-rw-r-- 1 1000 1000 211 Jan 27 05:41 main-backend-params-static.xml
-rw-rw-r-- 1 1000 1000 1.4K Jan 27 05:41 main-website-location.xml
-rw-rw-r-- 1 1000 1000 8.3K Jan 27 05:41 main-website.xml
-rw-rw-r-- 1 1000 1000 2.9K Jan 27 05:41 main.xml
-rw-rw-r-- 1 1000 1000 471 Jan 27 05:41 not-configured.xml
ā layout
Seems he is using the old socket from php5-fpm connect() to unix:/var/run/ajenti-v-php-fcgi-sitecom-php-fcgi-0.sock
Please post your /etc/ajenti/vh.json
, only the "locations" array
Here's the locations key of the json:
"locations": [
{
"custom_conf_override": false,
"path_append_pattern": false,
"pattern": "\\.php$",
"custom_conf": "",
"path": "",
"match": "regex",
"backend": {
"params": {
"pm_min": 1,
"pm_max": 2,
"php_admin_values": "",
"php_flags": "",
"pm": "dynamic"
},
"type": "php7.0-fcgi"
}
}
],
I think I got it. You're right:
Auto-generated nginx config refers the sock to
ajenti-v-php-fcgi-site-php-fcgi-0.sock
But it should be
ajenti-v-php7.0-fcgi-site-php7.0-fcgi-0.sock
How do I fix this ?
You have the updated ajenti-v-nginx?
https://github.com/Eugeny/ajenti-v/blob/master/vh-nginx/nginx.py https://github.com/Eugeny/ajenti-v/blob/master/vh-nginx/nginx_templates.py
Yes, I have both.
Weird, I have manually restarted all of the nginx services (from services tab) from the daemon and sites started popping up. Some issues remain but I can handle them , thanks @alessiodionisi for the interest and help! :bow:
@Ardakilic good!
I'm looking to update my websites to php7.0. What was the final upgrade process?
@Eugeny , can a formalized process be published on http://support.ajenti.org/list/27624-kb/?category=9332?
@ShadowXVII How to:
add-apt-repository ppa:ondrej/php && apt-get update
apt-get purge ajenti-v-php-fpm php5-* && apt-get autoremove
apt-get install php5.6-fpm php5.6-mysql php7.0-fpm php7.0-mysql
vh-php5.6-fpm
and/or vh-php7.0-fpm
on /var/lib/ajenti/plugins/
Please give feedback :)
Awesome, working. I used the plugins through apt-get and it worked fine. Had to reboot ajenti to get it to pick up the new plugins. Re-created the PHP 7 content handler and copied the config down.
Thanks!
I installed and now i get "Fatal-error-Call-to-undefined-function-simplexml_load_file()" i'm new at all this, i tried to find the solution but nothing, can anyone help me?
@shadowlik I had the exact same issue on a non-ajenti server. The fix was simply installing php7.0-xml
. As far as I can tell, between versions, it got separated as a different package.
The ondrej
repo no longer works. Is there an alternative place I can get php5.6-fpm and php7.0-fpm?
@bbbenji Repository link changed months ago.
Try this (holds both PHP5.6 and PHP7):
https://launchpad.net/~ondrej/+archive/ubuntu/php
And update, upgrade, dist-upgrade in order for packages to upgrade.
After upgrading to the 5.6 and 7.0 plugins I am getting Access Denied
on all files other than .php including directories without a trailing /. See: https://github.com/Eugeny/ajenti-v/issues/231
@bbbenji
Make sure URL pattern is \.php$
, and type is Regex in the content section.
New PHP7 module doesn't do it automatically for me, so I need to set it each time I create/edit FPM.
@Ardakilic Oh man, I have been fighting with this for a week now. This solved my issue. Thank you.
@bbbenji You're welcome, glad it solved your issue š
I have tried to install ajenti v after i did the workaorund that was discribed in the top but when I start the installation this will be the result.
The following packages have unmet dependencies: ajenti-v-php-fpm : Depends: php5-fpm but it is not installable E: Unable to correct problems, you have held broken packages.
Can anybody help me?
@flemssound which PHP version do you have?
try typing:
apt-cache search ajenti-v-
and install php ajenti package for the version to your use accordingly.
I've done the operations, error after.
global name 'TEMPLATE_LOCATION_CONTENT_PHP7_0_FCGI' is not defined Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/ajenti/plugins/main/main.py", line 158, in handle_message self.ui.dispatch_event(update['uid'], update['event'], update['params']) File "/usr/lib/pymodules/python2.7/ajenti/ui/__init__.py", line 72, in dispatch_event self.root.dispatch_event(uid, event, params) File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 382, in dispatch_event if child.dispatch_event(uid, event, params): File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 382, in dispatch_event if child.dispatch_event(uid, event, params): File "/usr/lib/pymodules/python2.7/ajenti/ui/element.py", line 388, in dispatch_event getattr(self, k)(**(params or {})) File "/var/lib/ajenti/plugins/vh/main.py", line 259, in save self.manager.update_configuration() File "/var/lib/ajenti/plugins/vh/api.py", line 347, in update_configuration self.webserver.create_configuration(self.config) File "/var/lib/ajenti/plugins/vh-nginx/nginx.py", line 160, in create_configuration .write(self.__generate_website_config(website)) File "/var/lib/ajenti/plugins/vh-nginx/nginx.py", line 140, in __generate_website_config ) if not website.maintenance_mode else '', File "/var/lib/ajenti/plugins/vh-nginx/nginx.py", line 139, in <genexpr> '\n'.join(self.__generate_website_location(website, location) for location in website.locations) File "/var/lib/ajenti/plugins/vh-nginx/nginx.py", line 68, in __generate_website_location content = TEMPLATE_LOCATION_CONTENT_PHP7_0_FCGI % { NameError: global name 'TEMPLATE_LOCATION_CONTENT_PHP7_0_FCGI' is not defined
Install add-apt-repository requisites
Add ppa:ondrej/php repository
Purge old php5 and ajenti-v-php-fpm
Install php5.6 & php7.0
Apply my new patched files and enjoy php5.6 & php7.0!
Available PHP7.0 packages:
Available PHP5.6 packages: