QNAP ( how to find full path for php81 ) global path for Apache81 php81 - qnap

QNAP TS-251+
I have a problem, I can't find the php file for the php81 version
where can I find the full path for php81 in apache81 please?
I tried too
find . -type d | grep php81
php -v
PHP 7.4.30 (cli) (built: Dec 15 2022 06:13:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Related

Composer Akeneo installation Could not open input file composer.phar

I am trying to install a PIM named Akeneo. The system requirements are all checked:
https://docs.akeneo.com/2.3/install_pim/manual/system_requirements/system_requirements.html
I am on Apache2 / Ubuntu 16.04
My /var/www/ directory all belongs to www-data:www-data ( ran chown -R www-data:www-data to install )
Error message from server : “Could not open input file: composer.phar”
Googled about it , got many results, and looked on the forums on stakoverflow, found answers from 2010 to 2018. I think I have maybe found out that the problem could be linked with the file "composer.phar", the way symlinks work on apache2, and composer installed globally or "inside individual project(s)".
Following 2 tutorials, I had to install composer to continue the install for that PIM.
My server says:
Composer (version 1.10.10) successfully installed to:
/usr/local/bin/composer
If I navigate to cd ~ and run ls I see there is "composer.phar" and "composer-setup.php" here.
I am confused because the Akeno tutorial says:
After extracting the file, change into the Akeneo directory and run
the commands below:
cd /var/www/html/akeneo/pim-community-standard
sudo php -d memory_limit=3G ../composer.phar install --optimize-autoloader --prefer-dist
sudo php bin/console cache:clear --no-warmup --env=prod
...
I don't understand the composer.phar install part . There are no composer.phar file inside any directories : not in /var/www/html/akeneo/ and not in /var/www/html/akeneo/pim-community-standard
Was it supposed to generate a composer.phar file there ? Should it find composer.phar one level above ( ../composer.phar ) ? I doubled checked the Akeneo PIM files , and the original .rar archive has no composer.phar file. Or, is it something to do with a symlink that accesses the global "composer.phar" which was with the global install ? Regarding symlinks, there are some in the "vendor" fodler of the PIM, and runing ls -l -a gives :
lrwxrwxrwx 1 www-data www-data 28 Feb 5 2020 doctrine -> ../doctrine/orm/bin/doctrine
lrwxrwxrwx 1 www-data www-data 34 Feb 5 2020 doctrine-dbal -> ../doctrine/dbal/bin/doctrine-dbal
lrwxrwxrwx 1 www-data www-data 46 Feb 5 2020 doctrine-migrations -> ../doctrine/migrations/bin/doctrine-migrations
lrwxrwxrwx 1 www-data www-data 56 Feb 5 2020 requirements-checker -> ../symfony/requirements-checker/bin/requirements-checker
lrwxrwxrwx 1 www-data www-data 51 Feb 5 2020 var-dump-server -> ../symfony/var-dumper/Resources/bin/var-dump-server
There is a composer.json and composer.lock file inside /var/www/html/akeneo/pim-community-standard . So confused because the turorial says to be inside pim-community-standard directory and run this : php -d memory_limit=3G ../composer.phar install --optimize-autoloader --prefer-dist
I hope I can resume the install without breaking anything. Some posts give the solution of updating composer, or installing composer-phar, inside the project. I am honestly totally lost.
( I don't know if I should bring that up, but is docker needed (not talked about in tutorial - but I see a folder with "docker" in it and I know that composer and docker can work together sometimes )
I moved the composer.phar file into the app directory. Now the install advanced. It's not a technical issue a misconfiguration or anything like that.
It's a lack of information about Composer on the Akeneo site but it's probably assumed that users should have knowledge about Composer allready.
Solution for me : moving the "composer.phar" file (from 'home' for me ) to the /var/www/project/ (.. the correct level directory).
So for my case it was a global / local install issue , which is still unclear, and I will have to look deeper how to properly install composer. Not sure if my current setup will not cause any issue later since it's like I installed it globally at first then moved only one file.
Also, command "composer" is not returning anything. I do have the composer file in /usr/bin/ though. This is very strange.

Recommended way of testing if I'm currently running under WSL [duplicate]

This question already has answers here:
How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu?
(15 answers)
Closed 5 years ago.
Can a bash script detect if it's running in "Ubuntu on Windows" vs native Ubuntu? If so, how?
I ran env on both machines and didn't see any obvious environmental variable differences. I could test for the existence of the /mnt/c directory, but that is not foolproof because that directory could potentially also be present on native Ubuntu.
It looks like /proc/version in Ubuntu on Windows contains:
Linux version 3.4.0-Microsoft (Microsoft#Microsoft.com) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014
and my version of Ubuntu has:
Linux version 4.4.0-31-generic (buildd#lgw01-16) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016
This code is working for me to detect which version of Ubuntu the script is running on:
if grep -qi microsoft /proc/version; then
echo "Ubuntu on Windows"
else
echo "native Linux"
fi

How to upgrade apache 2.2.15 to apache 2.4.12 on CentOS 6.6?

I tried ,but didn't work for me.
Apache 2.4 on CentOS 6.6:
Step 1:
cd /etc/yum.repos.d/
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo
Step 2:
yum install httpd24.x86_64
Step 3:
$ /opt/rh/httpd24/root/usr/sbin/httpd -version
Server version: Apache/2.4.6 (Red Hat)
Server built: Sep 25 2013 05:25:46
NOTE: config files are in: /opt/rh/httpd24/root/etc/httpd
$ ls
conf conf.d conf.modules.d logs modules run
EDIT: in case you want to switch off Apache 2.2
$ chkconfig httpd off
$ chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd24-httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
EDIT 2: http://wiki.apache.org/httpd/PHP-FPM
yum install php-fpm
/etc/init.d/php-fpm start
Does any body knows the solutions, please let me know.
It would be best if you built it yourself from the Apache source code on a CentOS 6.6 system.
Compiling and Installing Apache 2.4:
http://httpd.apache.org/docs/current/install.html
Make note of the configure line during the build so you can make sure it includes all the modules you want (Like mod_ssl...etc..). Details on what is available for the configure line located here http://httpd.apache.org/docs/current/programs/configure.html
$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-ldap=shared \
--enable-lua=shared
If you want your own RPM, create a SPEC file with your own customizations.
The easiest way is to install the SCL version, as described here:
https://unix.stackexchange.com/questions/412122/how-to-update-apache-to-2-4-29-using-scl

Installing Solaris Studio 12.2 in Ubuntu

I need help with installing Solaris Studio 12.2 on Ubuntu.
I looked at this question already and it didn't help: Installing Solaris Studio 12.2?
My problem with the solutions provided in that question is that I do not have a script to run when I extract the file I downloaded: SolarisStudio12.2-linux-x86-tar-ML.tar.bz2
To extract it I am just using the Ubuntu GUI, archive manager.
Could this be my problem?
Also I already posted this on askUbuntu: Got no response.
There is no installation script to run with the tarfile distribution. You just extract the archive somewhere and that's it, Solaris Studio is installed and ready to use. You just need to add its bin directory to your PATH.
I'm not familiar with Ubuntu GUI archive manager so here is how I proceed:
$ bunzip2 < SolarisStudio12.2-linux-x86-tar-ML.tar.bz2 | tar xf -
$ PATH=$PWD/SolarisStudio12.2-linux-x86-tar-ML/solstudio12.2/bin cc -V
cc: Sun C 5.11 Linux_i386 2010/08/13
usage: cc [ options ] files. Use 'cc -flags' for details

Version of Apache installed on a Debian machine

How can I check which version of Apache is installed on a Debian machine?
Is there a command for doing this?
Try apachectl -V:
$ apachectl -V
Server version: Apache/2.2.9 (Unix)
Server built: Sep 18 2008 21:54:05
Server's Module Magic Number: 20051115:15
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
... etc ...
If it does not work for you, run the command with sudo.
This works for my Debian:
$ /usr/sbin/apache2 -v
You should use apache2ctl -v or apache2 -v for newer Debian or Ubuntu distributions.
apache:/etc/apache2# apache2ctl -v
Server version: Apache/2.2.16 (Debian)
Server built: May 12 2011 11:58:18
or you can use apache2 -V to get more information.
apache2 -V
Server version: Apache/2.2.16 (Debian)
Server built: May 12 2011 11:58:18
Server's Module Magic Number: x
Server loaded: APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.2.12, APR-Util 1.3.9
Architecture: 64-bit
Server MPM: Worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
The command varies depending on how your version of Linux has named the Apache Server.
On Debian and Mac OS:
apachectl -v
On Red Hat and Amazon's EC2 Linux use:
httpd -v
On other verisons of Linux try:
apache2 -v
You can use two different flags:
-v # gives you the version number
-V # gives you the compile settings including version number.
If you want to run the command with the full directory like user3786265 did but don't know where your apache is located, use the whereis command:
whereis httpd
I am using Red Hat Linux and the following command works:
httpd -V
I think you have to be sure what type of installation you have binary or source.
To check what binary packages is installed: with root rights execute following command:
dpkg -l |grep apache2
result should be something like:
dpkg -l |grep apache2
ii apache2 2.4.10-10+deb8u8 amd64 Apache HTTP Server
ii apache2-bin 2.4.10-10+deb8u8 amd64 Apache HTTP Server (modules and other binary files)
ii apache2-data 2.4.10-10+deb8u8 all Apache HTTP Server (common files)
ii apache2-doc 2.4.10-10+deb8u8 all Apache HTTP Server (on-site documentation)
To find version you can run :
apache2ctl -V |grep -i "Server version"
result should be something like:
Server version: Apache/2.4.10 (Debian)
Try it with sudo
apachectl -V
-bash: apachectl: command not found
sudo apachectl -V
Server version: Apache/2.4.6 (Debian)
Server built: Aug 12 2013 18:20:23
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.3
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 32-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
bla bla....
You can also use the package manager directly:
dpkg -l | grep apache
This isn't focused on just version number, but it will make a broader search, which will give you other useful information, like module versions.
Another way round to check a package (including Apache) installed version on Debian-based system, we can use:
apt-cache policy <package_name>
e.g. for Apache
apt-cache policy apache2
which will show something like (look at the Installed line):
$ apt-cache policy apache2
apache2:
Installed: (none)
Candidate: 2.2.22-1ubuntu1.9
Version table:
2.2.22-1ubuntu1.9 0
500 http://hk.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
2.2.22-1ubuntu1 0
500 http://hk.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
For me this works on Debian 6 (Squeeze):
Linux www809 2.6.26-2-xen-686 #1 SMP Wed Sep 21 09:56:47 UTC 2011 i686 GNU/Linux
I had to go to the right path:
/usr/local/apache/bin** $ **./apachectl -v
./apachectl: line 71: ulimit: open files: cannot modify limit: Operation not permitted
Server version: Apache/2.2.21 (Unix)
Server built: Dec 17 2011 19:57:53
I tried running the command "httpd -V" and "apachectl -V", but I could not execute and was getting the error:
-ksh: php: not found [No such file or directory]
Then I tried another way. I went to the Apache directory on my server and then tried executing the command:
./apachectl -v
This worked for me and returned the output:
Server version: Apache/2.2.20 (Unix)
Server built: Sep 6 2012 17:22:16
I hope this helps.
You can use apachectl -V or apachectl -v. Both of them will return the Apache version information!
xgqfrms:~/workspace $ apachectl -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
xgqfrms:~/workspace $ apachectl -V
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3
Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.3
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
You may be more like using apache2 -V or apache2 -v. It seems easier to remember!
xgqfrms:~/workspace $ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
xgqfrms:~/workspace $ apache2 -V
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3
Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.3
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
For me apachectl -V did not work, but apachectl fullstatus gave me my version.
Some installations of Apache are fubar (think Oracle's packaging of it, OHS) and do not understand the -V flag, nor can be invoked directly without running into missing library errors.
Easiest way is to use the strings command (part of binutils) on the httpd binary and grep for a string that might resemble a version. For example, assuming your httpd binary is under directory /foo/bar:
$ strings /foo/bar/httpd | grep 2.2
GLIBC_2.2.5
Oracle-HTTP-Server/2.2.22 (Unix)
Success_Accepted_202
202 Accepted
Most binaries (not all) contain their version (at least their major version) as static strings. This is my go-to way to get versions (or to corroborate what a binary's help message matches what reality on the ground truly is.)
Or, less directly:
nmap -A localhost -p 80
Surely typing /usr/sbin/apache2 -v into the shell is the best and quickest way to go, by the way here's another option, just in case there's PHP too in your server and you're interested into gathering Apache version (and much more infos) in quick programmatical steps.
Just make an info.php file in your Apache web root folder (or whatever you like) and write these inside it:
<?php
phpinfo();
?>
Now go to yoursite.com/info.php (or localhost/info.php for local machines).
You'll see your Apache version in PHP Variables section, here's an example:
phpinfo() example dump page
Also, please notice that these steps obviously apply to any web server with PHP integration, so it's not limited to Apache and once created that page could be handy while developing (just don't forget to remove it on production environments!!)
dlocate -s apache2 | grep '^Version:'
works in debian 11 bullseye
/usr/sbin/apache2 -v