AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-581090

IgorAlves's questions

Martin Hope
IgorAlves
Asked: 2022-07-08 15:54:00 +0800 CST

Pyautogui.screenshot() 在 Ubuntu 22.04 上返回黑色 file.png:。如何解决这个问题?

  • 0

我正在两台不同的计算机上测试操作系统 Ubuntu 22.04 上的Pyautogui 。两个人吃都表现出相同的行为。
当我使用print(pt.screenshot('foo.png'))它时,它正在创建一个黑色foo.png文件。

我是使用这个库的新手。也许有一些 linux/Ubuntu 22.04 的配置没有引起我的注意。就像代码无法访问屏幕(我不知道),一些权限。

这是我用来测试的python代码:

# https://pyautogui.readthedocs.io/en/latest/quickstart.html

print('======== pyautogui Tests for Ubuntu 22.04 ========')
import cv2 as cv
print('OpenCV Path:', cv.__path__) # OpenCV Path: ['/home/xxx/.local/lib/python3.10/site-packages/cv2']

print('OpenCV Version:', cv.__version__) # OpenCV Version: 4.6.0

print('\n')

from time import sleep
# Waiting time
print('Waiting 5s')
sleep(5)

import pyautogui as pt

# Set up a 2.5 second pause after each PyAutoGUI call
# print('pt.PAUSE = 5')
# print('Set up a 5 second pause after each PyAutoGUI call')
# pt.PAUSE = 5
# print('Not Working. Need to setup sleep(5)')
# print('\n')

# Moving the mouse to the upper-left will raise a pyautogui.FailSafeException that can abort your program:
# print('pt.FAILSAFE = True')
# print('Moving the mouse to the upper-left will raise a pyautogui.FailSafeException that can abort your program')
# pt.FAILSAFE = True
# print('Not Working')
# print('\n')

# current mouse x and y
position = pt.position()  
print('Current mouse x and y')
print('position: ', position)
print('\n')

# Current screen resolution width and height
# screenSize = pt.size()  
# print('Current screen resolution width and height')
# print('screenSize: ', screenSize) # Size(width=1920, height=1080)
# print('\n')

# True if x & y are within the screen.
# print('True if x & y are within the screen')
# x = 200
# y = 400
# print('x: ', x)
# print('y: ', y)
# withinScreen = pt.onScreen(x, y)
# print('withinScreen-True: ', withinScreen)   # True
# x = 2000
# y = 4000
# print('x: ', x)
# print('y: ', y)
# withinScreen = pt.onScreen(x, y)
# print('withinScreen-False: ', withinScreen)  # False
# print('\n')

print('================ Mouse Functions ================')
# Move mouse to XY coordinates over num_second seconds
print('Move mouse to XY coordinates over num_second seconds')
num_seconds = 1
x = 200
y = 400
print('x: ', x)
print('y: ', y)
print('duration: ', num_seconds)
pt.moveTo(x, y, duration=num_seconds)  
# Result: we cant see the mouse moving in the screen but It seems like a invisible mouse - selects files in VSCODE
print('\n')

# move mouse relative to its current position
# print('move mouse relative to its current position')
# xOffset = 20
# yOffset = 40
# print('xOffset: ', xOffset)
# print('yOffset: ', yOffset)
# print('duration: ', num_seconds)
# pt.moveRel(xOffset, yOffset, duration=num_seconds)  
# print('\n')

while True:
    posXY = pt.position()
    print(posXY)
    # print(posXY[0])
    # print(posXY[1])
    # print(posXY,pt.pixel(posXY[0],posXY[1]))
    sleep(1)
    print('****')
    print('LocateCenter test2', pt.locateCenterOnScreen('./test2.png', confidence=0.7))
    print('Locate test2', pt.locateOnScreen('./test2.png', confidence=0.7))
    print('LocateCenter test3', pt.locateCenterOnScreen('./test3.png', confidence=0.7))
    print('Locate test3', pt.locateOnScreen('./test3.png', confidence=0.7))
    print('****')
    print('\n')
    if posXY[0] == 0:
        break

print('')
print('pt.screenshot()', pt.screenshot())
print(pt.screenshot('foo.png'))
print('================ Screen Functions ================')
print('Home Folder Coordinates')
print(pt.locateCenterOnScreen('./test2.png', confidence=0.4))

这是生成文件的行的输出(就在循环之后):

print('pt.screenshot()', pt.screenshot())
pt.screenshot() <PIL.PngImagePlugin.PngImageFile image mode=RGB size=1920x1080 at 0x7F68E2805870>
    
print(pt.screenshot('foo.png'))
<PIL.PngImagePlugin.PngImageFile image mode=RGB size=1920x1080 at 0x7F68E28059F0>

这是我的 pip3 列表:

$ pip3 list

Package                Version
---------------------- --------------
absl-py                1.1.0
apturl                 0.5.2
asgiref                3.5.2
attrs                  21.4.0
blinker                1.4
Brlapi                 0.8.3
certifi                2020.6.20
chardet                4.0.0
click                  8.0.3
colorama               0.4.4
command-not-found      0.3
cryptography           3.4.8
cssselect2             0.6.0
cupshelpers            1.0
cycler                 0.11.0
dbus-python            1.2.18
defer                  1.0.6
distlib                0.3.4
distro                 1.7.0
distro-info            1.1build1
Django                 4.0.6
django-embed-video     1.4.4
easy-thumbnails        2.8.1
filelock               3.7.1
fonttools              4.33.3
gpg                    1.16.0-unknown
httplib2               0.20.2
idna                   3.3
importlib-metadata     4.6.4
jeepney                0.7.1
keyring                23.5.0
kiwisolver             1.4.3
language-selector      0.1
launchpadlib           1.10.16
lazr.restfulclient     0.14.4
lazr.uri               1.0.6
louis                  3.20.0
lxml                   4.9.1
macaroonbakery         1.3.1
matplotlib             3.5.2
mediapipe              0.8.10
more-itertools         8.10.0
MouseInfo              0.1.3
netifaces              0.11.0
numpy                  1.22.4
oauthlib               3.2.0
olefile                0.46
opencv-contrib-python  4.6.0.66
opencv-python          4.6.0.66
packaging              21.3
paperclip              2.6.0
pexpect                4.8.0
Pillow                 9.0.1
pip                    22.0.2
platformdirs           2.5.2
protobuf               3.12.4
ptyprocess             0.7.0
PyAutoGUI              0.9.53
pycairo                1.20.1
pycups                 2.0.1
PyGetWindow            0.0.9
PyGObject              3.42.0
PyJWT                  2.3.0
pymacaroons            0.13.0
PyMsgBox               1.0.9
PyNaCl                 1.5.0
pyparsing              2.4.7
pyperclip              1.8.2
PyQt5                  5.15.6
PyQt5-sip              12.9.1
PyRect                 0.2.0
pyRFC3339              1.1
PyScreeze              0.1.28
PySocks                1.7.1
python-apt             2.3.0+ubuntu2
python-dateutil        2.8.1
python-debian          0.1.43ubuntu1
python3-xlib           0.15
pytweening             1.0.4
pytz                   2022.1
pyxdg                  0.27
PyYAML                 5.4.1
reportlab              3.6.8
requests               2.25.1
SecretStorage          3.3.1
setuptools             59.6.0
six                    1.16.0
sqlparse               0.4.2
svglib                 1.3.0
systemd-python         234
tinycss2               1.1.1
torbrowser-launcher    0.3.3
ubuntu-advantage-tools 27.8
ubuntu-drivers-common  0.0.0
ufw                    0.36.1
unattended-upgrades    0.1
urllib3                1.26.5
virtualenv             20.15.1
wadllib                1.3.6
webencodings           0.5.1
wheel                  0.37.1
xdg                    5
xkit                   0.0.0
zipp                   1.0.0

这是我的操作系统/Python:

$ python3 -V
Python 3.10.4


$ scrot -v
scrot version 1.7

# Tkinter
$ tclsh
% info patchlevel
8.6.12

$ apt list --installed
tk8.6-blt2.5/jammy,now 2.5.3+dfsg-4.1build2 amd64 [installed,automatic]
tk8.6/jammy,now 8.6.12-1build1 amd64 [installed,automatic]
tk/jammy,now 8.6.11+1build2 amd64 [installed,automatic]

附上它正在生成的文件 foo.png。 在此处输入图像描述

它应该是以下两个屏幕之一:在此处输入图像描述或在此处输入图像描述

一些想法那可能是什么或我错过了什么?

python
  • 1 个回答
  • 280 Views
Martin Hope
IgorAlves
Asked: 2020-06-23 08:13:21 +0800 CST

AWS-CLI 已安装但无法正常工作(未找到命令“aws”)Ubuntu 18.04。如何解决?

  • 1

按照以下步骤在全新的 Ubuntu 18.04中安装AWS-CLI:

  1. sudo apt update
  2. sudo apt upgrade
  3. sudo apt install python3-pip
  4. sudo apt install npm(我将使用 NodeJS)
  5. pip3 install awscli --upgrade --user

在第 5 步之后,我应该能够看到aws-cli版本。但这就是我得到的:

  1. aws --version

    找不到命令“aws”,但可以安装:

    sudo apt install awscli(我什么也没做)

但如果我签入ll ~/.local/bin 这就是我所拥有的:

drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 15:46 __pycache__/
-rwxrwxr-x 1 ubuntu ubuntu  815 Jun 22 15:46 aws*
-rwxrwxr-x 1 ubuntu ubuntu 1432 Jun 22 15:46 aws.cmd*
-rwxrwxr-x 1 ubuntu ubuntu  204 Jun 22 15:46 aws_bash_completer*
-rwxrwxr-x 1 ubuntu ubuntu 1136 Jun 22 15:46 aws_completer*
-rwxrwxr-x 1 ubuntu ubuntu 1807 Jun 22 15:46 aws_zsh_completer.sh*
  1. 如果我运行python3 -m awscli --version这就是我得到的:

    aws-cli/1.18.84 Python/3.6.9 Linux/4.15.0-1065-aws botocore/1.17.7

所以它似乎aws-cli已安装并且已经在~/.local/bin但不响应aws configure命令。

我错过了什么?

更新


这就是在$PATH

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
command-line aws 18.04
  • 1 个回答
  • 7903 Views
Martin Hope
IgorAlves
Asked: 2020-01-18 14:38:27 +0800 CST

如何使用 bash 从 JSON 中检索值?

  • 0

我在 bash 管道中有一个命令,它返回一个 JSON,如下所示:

$ aws iot get-registration-code
{
    "registrationCode": "abcd635"
}

我希望将值放在可以在代码中某处使用abcd635的变量中。code

//Pseudo code
regCode = aws iot get-registration-code;
code = regCode.registrationCode
do some stuf with the code variable.

这是一种无需使用即可实现此目的的方法jq吗?我认为这是因为 jq 对于这个简单的 JSON 来说太多了。

bash json
  • 1 个回答
  • 3545 Views
Martin Hope
IgorAlves
Asked: 2019-01-18 13:29:38 +0800 CST

如何在bash脚本中的双引号字符串中转义单引号?

  • 2

我正在尝试运行以下 bash 代码:

#!/bin/bash
export DEBIAN_FRONTEND=noninteractive

DB_USER='abc'
DB_USER_PASSWORD='123'
DB_MAGENTO='db_magento'

sudo apt-get update  
echo debconf mysql-server/root_password password $DB_USER_PASSWORD | sudo debconf-set-selections
echo debconf mysql-server/root_password_again password $DB_USER_PASSWORD | sudo debconf-set-selections        
sudo apt-get -qq install mysql-server > /dev/null # Install MySQL quietly
sudo mysql -uroot -p123  -e "CREATE SCHEMA ${DB_MAGENTO} DEFAULT CHARACTER SET utf8;SHOW DATABASES;CREATE USER \'${DB_USER}\'@'localhost' IDENTIFIED BY ${DB_USER_PASSWORD};GRANT ALL PRIVILEGES ON * . * TO \'${DB_USER}\'@'localhost'; FLUSH PRIVILEGES;SELECT Host,User,Password FROM mysql.user;"

我得到的错误ERROR at line 1: Unknown command '\''. 似乎与\'${DB_USER}\'.

如何正确转义这些单引号?

更新

Afetr @Sergiy 建议我收到另一个错误:

#!/bin/bash
export DEBIAN_FRONTEND=noninteractive

DB_USER='ila'
DB_USER_PASSWORD='123'
DB_MAGENTO='db_magento'

    mysql -uroot -p123  -e "SHOW DATABASES;CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY ${DB_USER_PASSWORD};GRANT ALL PRIVILEGES ON * . * TO '${DB_USER}'@'localhost'; FLUSH PRIVILEGES;SELECT Host,User,Password FROM mysql.user;"

错误:

$ sudo ./installMagento.sh 
mysql: [Warning] Using a password on the command line interface can be insecure.
+--------------------+
| Database           |
+--------------------+
| information_schema |
| db_magento         |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123' at line 1
scripts bash mysql
  • 1 个回答
  • 3758 Views
Martin Hope
IgorAlves
Asked: 2018-06-13 10:26:17 +0800 CST

ubuntu16.04.1 xdebug 上的 PHP 版本 7.1.18-1 不工作。如何启用它?

  • 0

我通过以下命令在 ubuntu 16.04 中安装了 php 7.1:

sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1-fpm   

在这一步之后,我只是按照以下说明进行操作Xdebug Tailored Installation Instructions:

Summary
Xdebug installed: no
Server API: FPM/FastCGI
Windows: no
Zend Server: no
PHP Version: 7.1.18-1
Zend API nr: 320160303
PHP API nr: 20160303
Debug Build: no
Thread Safe Build: no
Configuration File Path: /etc/php/7.1/fpm
Configuration File: /etc/php/7.1/fpm/php.ini
Extensions directory: /usr/lib/php/20160303
Instructions
Download xdebug-2.6.0.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.6.0.tgz
Run: cd xdebug-2.6.0
Run: phpize (See the FAQ if you don't have phpize.

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/20160303
Edit /etc/php/7.1/fpm/php.ini and add the line
zend_extension = /usr/lib/php/20160303/xdebug.so
Restart the webserver

重新启动网络服务器(NGINX)后,我在 phpinfo() 显示中看不到 xdebug 扩展:

在此处输入图像描述

这是我的 php.ini:/etc/php/7.1/fpm/php.ini

[xdebug]
zend_extension = /usr/lib/php/20160303/xdebug.so

甚至本文中建议的xdebug 2.5.5也不起作用,甚至Xdebug 2.7.0alpha1也不起作用

php -v
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 11 2018 14:22:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.18-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

有人知道如何解决这个问题吗?

16.04 php7 xdebug
  • 1 个回答
  • 1410 Views
Martin Hope
IgorAlves
Asked: 2018-03-12 04:38:48 +0800 CST

如何以编程方式检查是否安装了 getopts?如果没有,请安装它[重复]

  • 0
这个问题在这里已经有了答案:
如何检查我的服务器上是否安装了软件包? (14 个回答)
如何检查是否安装了软件包(没有超级用户权限)? (9 个回答)
4年前关闭。

运行 Ubuntu 16.04 如果未安装,我想安装(以编程方式)getopts。

在这篇文章之后,我正在做这样的事情:

GETOPTS=getopts

if [$GETOPTS==""] 
   then
   echo "Installing getopts"
   sudo apt-get install -y libperl4-corelibs-perl
fi

但它不起作用。

任何想法如何做到这一点?

bash
  • 1 个回答
  • 609 Views
Martin Hope
IgorAlves
Asked: 2018-01-07 08:35:23 +0800 CST

bash 中等效的 __LINE__ (php) 是什么?

  • 1

运行 Ubuntu16.04 我想在终端中显示正在运行的 bash 脚本中的行号。

如果它是在 php 中,它会是这样的例子:

echo "Installing NGINX. Line: ".__LINE__

我怎么能把它翻译成bash?

bash
  • 1 个回答
  • 149 Views
Martin Hope
IgorAlves
Asked: 2017-12-28 08:00:24 +0800 CST

如何通过终端获取和设置 php.ini 变量

  • 9

我想php.ini通过终端更改一些(php5.6)变量。示例:我需要获取post_max_size值(现在是8M),将其显示在终端中,将其更改为2048M并再次显示。

我怎么能那样做?

command-line
  • 3 个回答
  • 10848 Views
Martin Hope
IgorAlves
Asked: 2017-12-22 13:44:33 +0800 CST

如何在没有 Apache 的 Ubuntu16.04 上安装 php7.1?

  • 5

使用以下命令安装 php7.1:

sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update

sudo apt-get install -y php7.1
#Modules
sudo apt-get install -y php7.1-cli 
sudo apt-get install -y php7.1-common 
sudo apt-get install -y php7.1-json 
sudo apt-get install -y php7.1-opcache 
sudo apt-get install -y php7.1-mysql 
sudo apt-get install -y php7.1-mbstring 
sudo apt-get install -y php7.1-mcrypt 
sudo apt-get install -y php7.1-zip 
sudo apt-get install -y php7.1-fpm
sudo apt-get install -y php7.1-xml
sudo apt-get install -y php7.1-xmlrpc
#sudo apt-get install -y php-token-stream

它正在安装 Apache。我不想要这个。它正在安装期间install -y php7.1。

在此处输入图像描述

有没有办法在这个 php7.1 安装过程中避免使用 Apache?

16.04
  • 2 个回答
  • 13106 Views
Martin Hope
IgorAlves
Asked: 2017-11-21 12:00:06 +0800 CST

如何通过 bash 脚本将 DNS 插入 /etc/hosts?

  • 0

我有一个 bash 脚本runmydocker.sh,它应该抓取开发人员发送的 DNS 字符串,在运行他runmydocker.sh并在动态内部创建一个新的 DNS/etc/hosts并指向 docker 服务器时。

这是流程:

  • 获取用户发送的 DNS 并将其存储到 MYDNS 变量中
  • 复制当前主机的内容
  • 插入 127.0.0.1 $MYDNS
  • 调用 docker run ....

所以用户应该这样做:

./runmydocker.sh mysite.com

当它编写 URL mysite.com 时,它应该使用 docker 服务器。

所以我的问题是如何将这个新的 DNS 插入/etc/hosts?

bash
  • 1 个回答
  • 1302 Views
Martin Hope
IgorAlves
Asked: 2017-09-22 08:45:23 +0800 CST

如何通过 cli 在 ubuntu 16.04 中启用 php5-mysql?

  • 2

我想通过 cli 在我的 Ubuntu 16.04 中启用模块 php5-mysql 。

当我这样做时apt search php,我看到了php5-mysql is there。然后运行apt-get install php5-mysql,这就是我得到的:

root@25814ad2fc62:/var/www/html# apt-get install php5-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5-mysql is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

所以结论是该模块已安装但未启用。在那篇文章之后,我看到运行命令 php5enmod mysql 并且没有消息或错误。

运行后php -m我看到 mysql 不存在:

root@25814ad2fc62:/etc/php5/mods-available# php -m
[PHP Modules]
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

这些是我机器中的可用模块:

root@25814ad2fc62:/etc/php5/mods-available# ls
mysql.ini  mysqli.ini  opcache.ini  pdo.ini  pdo_mysql.ini  redis.ini

那么,如何在我的 php 实例中启用这个 mysql 模块?我在一个 docker 容器中运行。

drivers
  • 1 个回答
  • 9813 Views
Martin Hope
IgorAlves
Asked: 2016-12-13 16:08:54 +0800 CST

如何在自动安装 apt-get 期间跳过“请 [Enter] 继续”?[复制]

  • 3
这个问题在这里已经有了答案:
添加存储库时是否可以跳过确认步骤? (1 个回答)
5年前关闭。

我有一个脚本可以通过自动化过程进行安装。

这是一个例子:

  sudo apt-get update
    clear

    sudo apt-get install -y nginx
    clear

它工作得很好,但是当我需要添加 PPA 时就不行了。

在这里,我收到以下消息:

please [Enter] to continue or ...

此时我需要按回车键继续该过程。

我怎样才能跳过这个问题并默认将其设为“Enter”?

这是一个要求我按 [Enter] 的示例:

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install -y sublime-text-installer
clear

sudo add-apt-repository ppa:webupd8team/java  
sudo apt-get update
sudo apt install -y oracle-java8-installer
clear
automation
  • 1 个回答
  • 2272 Views
Martin Hope
IgorAlves
Asked: 2016-11-29 14:33:23 +0800 CST

如何在 Ubuntu 16.10 中从 Unity 8 切换?

  • 7

当我打开运行 Ubuntu 16.10 的计算机时,我只看到我的名字带有 Unity 8 符号。

在此处输入图像描述

当我输入密码时,它会将我引导至 Unity 8 桌面环境。

在此处输入图像描述

如何返回到常规的 Ubuntu 桌面环境?

16.10
  • 2 个回答
  • 1381 Views
Martin Hope
IgorAlves
Asked: 2016-11-23 06:50:54 +0800 CST

如何通过脚本在 MariaDb/Mysql 中插入新用户?

  • 0

我有一个在新的 linux OS 16.10 中安装软件的脚本。

假设该文件名为 insert_app.txt。

我这样称呼这个脚本:

# source  insert_app.txt.

然后以非交互模式安装软件。

这是安装 MariaDb 的部分

sudo apt-get update
sudo apt-get install -y mariadb-server

效果很好。安装数据库后,我需要创建用户并设置权限,如下所示:

CREATE USER 'user1'@'localhost' IDENTIFIED BY 'psswordUser1';
GRANT ALL PRIVILEGES ON * . * TO 'user1'@'localhost';
FLUSH PRIVILEGES;

为此,我需要等待所有软件安装完毕,然后像 mysql -uroot -pPassword 这样输入数据库,然后运行前面的命令来创建用户。

我的问题是:

有没有办法将这些命令放在同一个管道中?我的意思是,像这样:

....

sudo apt-get update
sudo apt-get install -y mariadb-server
mysql -uroot -pPsswrd
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'psswordUser1';
GRANT ALL PRIVILEGES ON * . * TO 'user1'@'localhost';
FLUSH PRIVILEGES;

...
COntinue install the softwares...

它不工作。

一些帮助?

16.10
  • 2 个回答
  • 1077 Views
Martin Hope
IgorAlves
Asked: 2016-09-02 15:00:54 +0800 CST

如何为 PHP 7+ 安装 phpize

  • 37

我尝试使用 PHP7.0-fmp 在我的 Ubuntu 16.04 中安装 xdebug。

在量身定制的工具中,它说:

Run: phpize (See the FAQ if you don't have phpize.

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
If it does not, you are using the wrong phpize. 
Please follow this FAQ entry and skip the next step.

常见问题解答仅参考 php5-dev 以安装 phpize。

然后按照如何安装和运行phpize我发现php7.0-dev也应该安装phpize。

当我尝试运行时,sudo apt-get install php7.0-dev我收到消息:

php7.0-dev is already the newest version (7.0.8-0ubuntu0.16.04.2).
The following package was automatically installed and is no longer required:
  linux-image-extra-4.4.0-21-generic

这表示所有 php7.0-dev 软件包都已安装,但是当我运行时,phpize我收到以下消息:

root@ig:/usr/bin# phpize
Cannot find config.m4. 
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

我已经在里面了/usr/bin/。在这种情况下如何运行 phpize?

apt
  • 2 个回答
  • 88378 Views
Martin Hope
IgorAlves
Asked: 2016-08-12 19:42:17 +0800 CST

如何将新组添加到用户root?

  • 7

我正在运行 Ubuntu 16.04 作为 Windows 7 主机的来宾。

我在 Windows 中共享了一个文件夹,我应该能够在 Linux 中查看和打开该文件。

问题是我作为 root 无法打开文件,因为 root 不在vboxsf组中。

从这篇文章中,我刚刚运行了这个命令:

$ usermod -G vboxsf rootusername

之后我就失去了root权限。我不能使用sudo su命令,不能打开根文件等。

那么如何在vboxsf不丢失所有管理员权限的情况下添加 rootUser 呢?

root
  • 2 个回答
  • 18399 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve