PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label centos7. Show all posts
Showing posts with label centos7. Show all posts

Sunday, November 13, 2022

[FIXED] how to install ffmpeg php extension on plesk centos7

 November 13, 2022     centos, centos7, ffmpeg, php, plesk     No comments   

Issue

please help me installing FFMEPG, i have instilled it but there is no extension in php setting.

in php.d ffmepg is not there.

anyone one know how to install it.


Solution

For PHP >=7.0, simply use composer:

# /opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar install php-ffmpeg/php-ffmpeg

For earlier PHP versions:

1. Make sure EPEL is enabled:

# yum repolist | grep epel
*epel/x86_64 Extra Packages for Enterprise Linux 7 - 12559

If it is not, enable it as follows:

# yum install epel* -y

2. Enable RPM Fusion:

# yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
# yum localinstall --nogpgcheck https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm

3. Install FFmpeg and dependencies:

# sudo yum install ffmpeg ffmpeg-devel mplayer mencoder flvtool2 libogg libvorbis lame
# sudo yum install make plesk-php56-devel gcc glibc-devel zlib-devel

4. Download ffmpeg-php:

# git clone https://github.com/nilsringersma/ffmpeg-php
# cd ffmpeg-php 
# /opt/plesk/php/5.6/bin/phpize

5. Do configure & make:

# ./configure --with-php-config=/opt/plesk/php/5.6/bin/php-config --enable-skip-gd-check
# make 
# make install

6. Enable the extension:

# echo "extension=ffmpeg.so" > /opt/plesk/php/5.6/etc/php.d/ffmpeg.ini
# plesk bin php_handler --reread

For more general instructions, refer to this guide.



Answered By - Elvis Plesky
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

[FIXED] How can i enable libmongoc ssl?

 November 13, 2022     centos7, linux, php-7.2, plesk     No comments   

Issue

Im using plesk 12 and PHP7 on centos 7. How can i enable libmongoc ssl on my server?

enter image description here


Solution

Try to compile it with

yum install git plesk-php70-devel make gcc openssl-devel

git clone https://github.com/mongodb/mongo-php-driver.git

cd mongo-php-driver/

git submodule update --init

/opt/plesk/php/7.0/bin/phpize

./configure --with-php-config=/opt/plesk/php/7.0/bin/php-config --with-mongodb-ssl=openssl

make

cp /root/mongo-php-driver/modules/mongodb.so /opt/plesk/php/7.0/lib/php/modules/

plesk bin php_handler --reread

After that in phpinfo() you will see:

libmongoc SSL enabled

libmongoc SSL library OpenSSL

libmongoc crypto enabled

libmongoc crypto library libcrypto



Answered By - IgorG
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, September 28, 2022

[FIXED] How to (forcefully) install a specific package version on Centos

 September 28, 2022     centos7, continuous-deployment, continuous-integration, yum     No comments   

Issue

In a ci/cd environment, i want to be able to update or downgrade a package to a specific version. To do this with yum, one needs to know the already installed version of a packge, eg one can use yum install to install a new package or update to a newer version. yum downgrade can be used to replace it with an earlier version.

Is there a way to use one command to install a specific version of a package?

Background: We continuously add new package versions to our yum channel on artifactory, so our yum channel doesn't really reflect a stable state. One should be able to install or downgrade a specific package with one yum install <package_name>-<package_version>


Solution

UPDATE#2 (please see below for older answers)

Now going with the following approach:

  1. check the already installed version
  2. if the specified version is already installed, do nothing
  3. if a newer version is installed, do a yum downgrade
  4. else, do a yum install (which also updates)

install-utils.sh:

#!/usr/bin/env bash

EXIT_FAILURE=1

function get_installed_version() {

    pkg_name=$("rpm -q --queryformat \
                          '%{NAME}-%{VERSION}-%{RELEASE}' ${pkg_name}" | tail -1)
    [ $? -ne 0 ] && pkg_name=""
    echo ${pkg_name}
}

function is_version_newer() {
    [[ $1 != $(echo -e "$1\n$2" | sort -V | head -1) ]]
}

function install_package(){
    local pkg_name="$1"
    local pkg_ver_rel="$2"
    local pkg_full_name="${pkg_name}-${pkg_ver_rel}"

    echo "Package to install: $pkg_full_name"
    installed_pkg="$(get_installed_version $pkg_name)"
    echo "Package version installed: $installed_pkg"

    if [[ "$installed_pkg" == "$pkg_full_name" ]]; then
        echo "Requested package version '$pkg_full_name' is " \
             "already installed. Nothing to do."
    elif is_version_newer "$installed_pkg" "$pkg_full_name"; then
        echo "Downgrading to $pkg_full_name ..."
        yum -y downgrade $pkg_full_name \
        && echo "Successfully downgraded to $pkg_full_name" \
        || { echo "Failed to downgrade to $pkg_full_name"; exit $EXIT_FAILURE; }
    else
        echo "Installing $pkg_full_name ..."
        yum -y install $pkg_full_name \
        && echo "Successfully installed package $pkg_full_name" \
        || { echo "Failed to install $pkg_full_name"; exit $EXIT_FAILURE; }
    fi
}

OLDER UPDATE: The (below answer) is not a good approach. Reason: Often, the version to be installed is not fully specified. So instead of giving 'version-release-architecture-epoch' (where architecture and epoch may be omitted) there is only the version specified, meaning: The latest available package for version shall be used. (eg. see this answer to "What's the rule for the Name-Version-Release of RPM?"). The approach given here will lead to an implicit downgrade to the last but one available version.

For example, one wants to install version: '0.11.1', which is already installed with version: 0.11.1-1. And available upstream is '0.11.1-SNAPSHOT20171030093532' and '0.11.1-2'. The install will update to the newest '0.11.1-2', but that would not match with the pkg_full_name, so a yum downgrade is performed, which let's the package manager select the snapshot version to be installed.

INITIAL ANSWER

For now, my best guess is to use some combination of yum install, '(check installed version)' and yum downgrade if it is not the specified version.

Eg:

pkg_name="somepackage"
pkg_full_name="somepackage-1.0.4-SNAPSHOT20171027143208"
echo "Installing $pkg_full_name ..."
yum -y install $pkg_full_name || \
{ echo "Failed to install $pkg_full_name"; exit 1; }
installed_package=$(rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}' ${pkg_name})
if [ "${installed_package}" != "${pkg_full_name}" ]; then
    sudo yum -y downgrade $pkg_full_name || \
    { echo "Failed to downgrade to $pkg_full_name"; exit 1; }
fi
echo "Successfully installed package $pkg_full_name"


Answered By - huch
Answer Checked By - Robin (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, September 21, 2022

[FIXED] Why my Redmine site is shown without any Virtual Host settinig?

 September 21, 2022     centos7, redmine, virtualhost     No comments   

Issue

I've installed Redmine 3.2.4.stable.16111 on to my VPS. I haven't written any Virtual Host settings for Redmine. Only added server name "redmine" as CNAME to my DNS records.

Why Redmine works without Virtual Host settings?

I installed Redmine according to Redmine's official Japanese page, so I guess it was installed at /var/lib/redmine/. But under that directory, no "public" folder. So I also wonder why Redmine works fine.

Any help will be appreciated.

Thank you.


Solution

Well Redmine is written in Ruby language. A Redmine website can be served by different web servers, such as Apache, Nginx. Web brick is a simple http server written in Ruby language that can be used to quickly get started with Redmine. By default it runs over port 3000. It does not require any virtual hosts.

Redmine can also be run with a combination of web servers. For example Apache web server can work as reverse proxy for the Web brick server.



Answered By - Nadir Latif
Answer Checked By - David Goodson (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

[FIXED] How to enable https in xampp with centos OS?

 September 21, 2022     centos7, virtualhost, xampp     No comments   

Issue

I have xampp in centos 7 OS, I want to add https on the xampp.

how I can fix it?


Solution

Please follow these solutions step by step as they suggested.

https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-centos-6

https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-apache-for-centos-7



Answered By - Gufran Hasan
Answer Checked By - Willingham (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, July 4, 2022

[FIXED] How to redirect output of systemd service to a file

 July 04, 2022     centos7, linux, rhel, rhel7, systemd     No comments   

Issue

I am trying to redirect output of a systemd service to a file but it doesn't seem to work:

[Unit]
Description=customprocess
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server
StandardOutput=/var/log1.log
StandardError=/var/log2.log
Restart=always

[Install]
WantedBy=multi-user.target

Please correct my approach.


Solution

I think there's a more elegant way to solve the problem: send the stdout/stderr to syslog with an identifier and instruct your syslog manager to split its output by program name.

Use the following properties in your systemd service unit file:

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=<your program identifier> # without any quote

Then, assuming your distribution is using rsyslog to manage syslogs, create a file in /etc/rsyslog.d/<new_file>.conf with the following content:

if $programname == '<your program identifier>' then /path/to/log/file.log
& stop

Now make the log file writable by syslog:

# ls -alth /var/log/syslog 
-rw-r----- 1 syslog adm 439K Mar  5 19:35 /var/log/syslog
# chown syslog:adm /path/to/log/file.log

Restart rsyslog (sudo systemctl restart rsyslog) and enjoy! Your program stdout/stderr will still be available through journalctl (sudo journalctl -u <your program identifier>) but they will also be available in your file of choice.

Source via archive.org



Answered By - Valerio Versace
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, April 13, 2022

[FIXED] How to start the websocket server automatically when it was stopped or server was rebooted after a long time

 April 13, 2022     centos7, linux, php, phpwebsocket     No comments   

Issue

I am using the ratchet websocket server on CentOs. The problem is it is stopped after some time. I have used the screen command to solve the problem but when server is rebooted it does not

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, February 28, 2022

[FIXED] CentOS 7 AMPPS Launch Issue

 February 28, 2022     ampps, centos, centos7, lamp, lib     No comments   

Issue

I am in the process of setting up a Linux Based AMPPS LAMP box for local web development needs before the projects go live. I have been following this installation guide for AMPPS website, on a fresh install of CentOS: https://www.ampps.com/wiki/Installing_AMPPS_on_Linux#Important_Locations

The following is stated in the instructions:

First Run of AMPPS When you run AMPPS for the first time make sure your Internet connection is active. Note: AMPPS doesn't support proxy yet. So you must have a Direct Internet Connection.

Now open /usr/local/ampps/Ampps from Explorer, this will take some time as it is setting up AMPPS for your Linux. If you are using Ubuntu OS then you have to start Ampps from terminal with sudo privilege.

cd /usr/local/ampps

sudo ./Ampps

Upon entering ./Ampps in as root, the terminal returns the following:

./Ampps: error while loading shared libraries: libXrender.so.1: cannot open shared object file: no such file or directory

I have done a little of a search and turned up basic fixes, such as:

yum install libXrender.so.1

Even with the libraries installed it throwing the same error.

Any help would be great, Sorry if my post lacks anything its my first :)

Thanks in advance, Jon


Solution

This seemed to do the trick guys, Thanks anyways :D

$ yum groupinstall "X Window System" "Desktop" "Desktop Platform" "Fonts"


Answered By - Jon - Hardwired Hosting
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, February 2, 2022

[FIXED] I cannot connect after enable Firewalld on CentOS7

 February 02, 2022     centos, centos7, firewalld, lamp     No comments   

Issue

I'm trying to setup LAMP to CentOS7 with a guide. I tried to run these commands to allow HTTP and HTTPS traffic:

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

But system give this error:

FirewallD is not running

So I searched for it then apply these commands:

systemctl enable firewalld
systemctl start firewalld

Then it printed "completed" output but my connection was aborted and I cannot connect to the server with IP:Port with PuTTy anymore.

What should I do? The only access to the server was that way for me. I have no physical access to the server.


Solution

It looks like you locked yourself out, as you did not specify that ssh should also be allowed:

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --permanent --zone=public --add-service=ssh
sudo firewall-cmd --reload

The guide above seems to assume that ssh is already allowed.

What should I do? The only access to the server was that way for me. I have no physical access to the server.

So at this point the only way to access the server will typically be via the VM console of your hosting provider / virtualisation solution. Almost all providers will allow you access to that console, so you should try to do that. Once logged in via the console, you can then run the above command to allow SSH to regain access via SSH.



Answered By - Simon
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing