- 论坛徽章:
- 0
|
配置LAMP的时候出现的错误提示及解决方法
1、启动MYSQL出错,提示:
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/xmcncn.pid
061103 15:25:32 mysqld ended
解决方法:
vi /etc/my.conf
看看[mysqld]下有没有
port = 3306
添加上就可以了
touch /tmp/mysql.sock
killall -9 mysqld
/usr/local/mysql/bin/mysqld_safe -user=mysql &
成功启动
2、启动APACHE出错,提示:
httpd: apr_sockaddr_info_get() failed for
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Wed Jun 06 18:13:13 2007] [warn] (2)No such file or directory: Failed to enable
解决方法:
需要修改vi httpd.conf文件,ServerName=www.example.com
#apache start
apache启动正常了
3、编译PHP的时候出错,提示:
/usr/bin/ld: Warning: size of symbol `CRYPTO_add_lock' changed from 7 in /data/mysql/lib/mysql/libmysqlclient_r.a(libtaocrypt_la-misc.o) to 102 in /data/server/openssl/lib/libcrypto.a(cryptlib.o)
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
解决方法一:重新编译安装MYSQL的时候加上 --enable-thread-safe-client.
原因:--enable-thread-safe-client #Compile the client with threads. 如果没有这个参数,编译php的时候会报"Cannot find libmysqlclient_r under”之类的错误。
其实这跟PHP没有关系
那是因为我在编译APACHE的时候,使用--with-mpm模块,所以就必须在编译MYSQL的时候加上 --enable-thread-safe-client.
这是PHP5.2的一个改进,在PHP5.2.0之前的版本都不需要MYSQL启用安全线程
解决方法二:编译之前,先处理一下mysql的库,默认查找libmysqlclient_r.so,可是mysql默认为libmysqlclient.so,内容完全一样,做个链接即可
# cd /data/mysql/lib/mysql/
# ln -s libmysqlclient.so.15.0.0 libmysqlclient_r.so
照做。
再次重新编译安装PHP
顺利通过!
4:配置MYSQL主从服务器的时候出错,启动slave服务的时候提示:
mysql> slave start;
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO
出现错误,然后再执行Change master语句就可以解决:
解决方法: 在从属服务器上执行:
mysql> change master to master_host='122.70.135.123',master_user='backup',master_password='Oc6]Ev Hc2#',master_log_file='ccxy_db.000008' ,master_log_pos=98;
Query OK, 0 rows affected (0.01 sec)
接着执行:
mysql> slave start;
Query OK, 0 rows affected (0.01 sec)
5:启动apache的时候出现如下错误:
(9 Address already in use: make_sock: could not bind to address [::]:80
(9 Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
解决方法:
netstat -natup |grep 80 查看端口
ps -A|grep httpd 查看程序
kill -9 16789 删除程序
再次启动apache即可
6:普通用户远程ssh登陆服务器后使用su时会提示“Permission denied”
使用su有两个条件,一是用户必须在wheel用户组中,二是su命令必须设置正确的suid。
如果用户不在wheel用户组中,su时会提示“Permission denied”。这时把用户(这里假定为xxx)加入wheel组中:
解决方法:
代码:
gpasswd -a xxx wheel
7:用浏览器打开phpMyAdmin出现以下的错误提示:
Wrong permissions on configuration file, should not be world writable!
这是权限的问题
解决方法:chmod 555 phpMyAdmin
chmod 755 config.inc.php
重启apache /data/server/apache/bin/apachecth restart
再次用浏览器打开就可以了
8:修复表命令
网页上出现如下错误:
Discuz! info: MySQL Query Error
解决方法:修复损坏的表,查看日志,查询那个表损坏,比如说bbs_crons坏掉了,执行如下命令
/data/mysql/bin/myisamchk -c -r xj71/bbs_crons.*
9:配置mysql主从的错误提示
(1)Slave_IO_Running 为No.
看日志localhost.err里面的信息
051107 11:25:26 Slave I/O thread: error connecting to master 'zhang@host137.zhang.edu:3309':
Error: 'Unknown MySQL Server Host 'host137.zhang.edu' (1)' errno: 2005 retry-time: 60
retries: 86400
因为没有给用户授权,执行
mysql>flush privileges;
第二种可能:
可能会是B的master 的信息有变化,
查看B SHOW MASTER STATUS;
记录下 File,Position 字段. 假设为'mysql_binary_log.000004',98 ;
在A 下执行:
Slave stop;
CHANGE MASTER TO
MASTER_LOG_FILE = 'mysql_binary_log.000004',
MASTER_LOG_POS = 98 ;
Slave start;
(2)Slave_SQL_Running 为No.
Err文件中记录:
Slave: Error 'Duplicate entry '1' for key 1' on query....
可能是master 未向slave 同步成功,但slave中已经有了记录。造成的冲突.
可以在A上执行
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 冲突的字节;
跳过几步。再
restart salve;
就可以了。
第二种可能:
出现这样的提示:Could not parse relay log event entry
解决的方法:在主数据库里执行:SHOW MASTER STATUS;
| File | Position | Binlog_do_db | Binlog_ignore_db |
+---------------+----------+--------------+------------------+
| mysql-bin.030 | 870279 | | |
+---------------+----------+--------------+------------------+
在从数据库里执行:stop slave;
CHANGE MASTER TO MASTER_LOG_FILE = 'mysql_master-bin.030',MASTER_LOG_POS = 870279;
start slave;
show slave status \G;
10:
网页出现类似的错误:
Warning: Cannot modify header information - headers already sent by (output started at /home/part/part/inc/selectln.php:1) in /home/part/part/inc/selectln.php on line 57
解决方法:
把php.ini中output_buffering = off改为output_buffering = on
11:
checking host system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
在做 configure 的时候,报上述的错误。
解决方案:
把 /usr/share/libtool/config.guess 覆盖到相关软件自带的config.guess
把 /usr/share/libtool/config.sub 覆盖到相关软件自带的config.sub
./configure --enable-shared --enable-static
12:编译apache出错
checking for C compiler default output file name... configure: error: C compiler cannot create executables
解决方法:
#CC=gcc;export CC
#PATH=$PATH:/opt/sfw/bin;export PATH
export CC=/usr/bin/gcc
cp /usr/share/libtool/config.guess /data/lamp/httpd-2.2.6/build/
cp /usr/share/libtool/config.sub /data/lamp/httpd-2.2.6/build/ |
|